You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reproducible in 4.3 builds and earlier. Tested using current wsl_peer.cpp master for 4.4.
System information
MacOS 13.6.5
Issue description
When a WebSocketPeer is connected using StreamPeerTLS, the speed of putting a packet in the direction of server->client is MUCH slower than in the client->server direction. Without TLS, the speeds are the same in both directions.
I'm using the latest improvements that should be ensuring TCP_NODELAY is always set, but could this not be propogating when using StreamPeerTLS? I'm also redundantly setting set_no_delay(true) in the MRP and that doesn't change the behavior.
In the MRP when using TLS, transferring a 215kb packet client-to-server takes 5msec, and up to 167msecs server-to-client. Without TLS, the transfer is symetrical at about 2msecs in both directions.
The delay/slowdown is consistant regardless of the max packet size or size of the packet, although the delay increases the larger the packet.
I modified the WebSocket Chat demo project to transfer a binary packet in both directions and report the transfer time. The TLS option can be toggled on an off for the WebSocketServer class using the Inspector.
Unlike StreamPeerTCP, StreamPeerTLS has no set_no_delay() method. Does this mean that after the connection is opened, calls to set_no_delay have no effect? Is this a matter of exposing this setting for mbedTLS?
Unlike StreamPeerTCP, StreamPeerTLS has no set_no_delay() method. Does this mean that after the connection is opened, calls to set_no_delay have no effect? Is this a matter of exposing this setting for mbedTLS?
set_no_delay is an option of the TCP socket which is why there is no such option for the TLS stream.
The WSLPeer is setting that option automatically for both server and client since Godot 4.3, no matter if it's using TLS or not (in the case of TLS, it's setting it in the underlying TCP connection).
Tested versions
Reproducible in 4.3 builds and earlier. Tested using current wsl_peer.cpp master for 4.4.
System information
MacOS 13.6.5
Issue description
When a
WebSocketPeer
is connected usingStreamPeerTLS
, the speed of putting a packet in the direction of server->client is MUCH slower than in the client->server direction. Without TLS, the speeds are the same in both directions.I'm using the latest improvements that should be ensuring TCP_NODELAY is always set, but could this not be propogating when using
StreamPeerTLS
? I'm also redundantly settingset_no_delay(true)
in the MRP and that doesn't change the behavior.In the MRP when using TLS, transferring a 215kb packet client-to-server takes 5msec, and up to 167msecs server-to-client. Without TLS, the transfer is symetrical at about 2msecs in both directions.
The delay/slowdown is consistant regardless of the max packet size or size of the packet, although the delay increases the larger the packet.
I modified the WebSocket Chat demo project to transfer a binary packet in both directions and report the transfer time. The TLS option can be toggled on an off for the
WebSocketServer
class using the Inspector.Here is WITHOUT TLS:
Screen.Recording.2024-10-14.at.10.51.22.AM.mov
And here is WITH TLS:
Screen.Recording.2024-10-14.at.10.52.22.AM.mov
Steps to reproduce
See MRP.
Minimal reproduction project (MRP)
websocket_chat_TLS_transfer_speed_bug.zip
The text was updated successfully, but these errors were encountered: