Merge pull request #35516 from Faless/ws/fix_latency_32

Lower WebSocket latency, fixes.
This commit is contained in:
Rémi Verschelde 2020-01-26 19:03:00 +01:00 committed by GitHub
commit f0f0f38d1a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 4 deletions

View file

@ -114,7 +114,7 @@ NetworkedMultiplayerPeer::ConnectionStatus WebSocketServer::get_connection_statu
return CONNECTION_CONNECTED;
return CONNECTION_DISCONNECTED;
};
}
bool WebSocketServer::is_server() const {

View file

@ -243,6 +243,10 @@ Error WSLPeer::put_packet(const uint8_t *p_buffer, int p_buffer_size) {
msg.msg_length = p_buffer_size;
wslay_event_queue_msg(_data->ctx, &msg);
if (wslay_event_send(_data->ctx) < 0) {
close_now();
return FAILED;
}
return OK;
}

View file

@ -165,9 +165,7 @@ Error WSLServer::listen(int p_port, const Vector<String> p_protocols, bool gd_mp
for (int i = 0; i < p_protocols.size(); i++) {
pw[i] = p_protocols[i].strip_edges();
}
_server->listen(p_port, bind_ip);
return OK;
return _server->listen(p_port, bind_ip);
}
void WSLServer::poll() {