diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-01-26 19:03:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-26 19:03:00 +0100 |
commit | f0f0f38d1a50117f4af19c347159535f706550db (patch) | |
tree | 5e93282ab2acdcc8d3e37e15959507892a1aff6a | |
parent | 9ed14815d8f2fd0dc3b91a65e85cec43a8b5f0ef (diff) | |
parent | 5bd9f14ad9364b3e0331cf10278750741d149c92 (diff) |
Merge pull request #35516 from Faless/ws/fix_latency_32
Lower WebSocket latency, fixes.
-rw-r--r-- | modules/websocket/websocket_server.cpp | 2 | ||||
-rw-r--r-- | modules/websocket/wsl_peer.cpp | 4 | ||||
-rw-r--r-- | modules/websocket/wsl_server.cpp | 4 |
3 files changed, 6 insertions, 4 deletions
diff --git a/modules/websocket/websocket_server.cpp b/modules/websocket/websocket_server.cpp index 76e88d72b9..a7ced65543 100644 --- a/modules/websocket/websocket_server.cpp +++ b/modules/websocket/websocket_server.cpp @@ -114,7 +114,7 @@ NetworkedMultiplayerPeer::ConnectionStatus WebSocketServer::get_connection_statu return CONNECTION_CONNECTED; return CONNECTION_DISCONNECTED; -}; +} bool WebSocketServer::is_server() const { diff --git a/modules/websocket/wsl_peer.cpp b/modules/websocket/wsl_peer.cpp index 2f7f84c893..d7914295e9 100644 --- a/modules/websocket/wsl_peer.cpp +++ b/modules/websocket/wsl_peer.cpp @@ -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; } diff --git a/modules/websocket/wsl_server.cpp b/modules/websocket/wsl_server.cpp index c3dd79a89c..44bfb4441d 100644 --- a/modules/websocket/wsl_server.cpp +++ b/modules/websocket/wsl_server.cpp @@ -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() { |