I'm using the ClientWebsocket to connect to the socket server on Binance, however I've run into an issue where the Response is delay by exactly 1 KeepAliveInterval each +- 4000 bytes. For example, when I have set a 10 second KeepAliveInterval in the socket options and send 3000 bytes to the server the response is received in +-260ms which is a normal latency. If I sent 4500 bytes the response is received in +-10260ms and if I sent 8500 bytes it is 20260ms.
Initially I figured this was something on Binances side but they told me this only seems to happen with the Dotnet socket implementation and that there might be an issue on the client side with that.
Tagging subscribers to this area: @dotnet/ncl
See info in area-owners.md if you want to be subscribed.
Issue Details
### Description
I'm using the ClientWebsocket to connect to the socket server on Binance, however I've run into an issue where the Response is delay by exactly 1 KeepAliveInterval each +- 4000 bytes. For example, when I have set a 10 second KeepAliveInterval in the socket options and send 3000 bytes to the server the response is received in +-260ms which is a normal latency. If I sent 4500 bytes the response is received in +-10260ms and if I sent 8500 bytes it is 20260ms.
Initially I figured this was something on Binances side but they told me this only seems to happen with the Dotnet socket implementation and that there might be an issue on the client side with that.
Thread discussing this with Binance:
https://dev.binance.vision/t/socket-live-subscribing-server-delay/9645
Gist for reproducing the issue:
https://gist.github.com/JKorf/afd5bd11f49670b85031df962f37b468
### Reproduction Steps
Have a ClientWebsocket and change the KeepAliveInterval while sending a request > 4000 bytes to the server. See gist
https://gist.github.com/JKorf/afd5bd11f49670b85031df962f37b468
### Expected behavior
Expected not to have the KeepAliveInterval have any influence on the response time
### Actual behavior
Response is delay by KeepAliveInterval
### Regression?
_No response_
### Known Workarounds
Sending < 4000 bytes doesn't have the issue
### Configuration
Dotnet 6
Windows 10 X64
### Other information
_No response_
Description
I'm using the ClientWebsocket to connect to the socket server on Binance, however I've run into an issue where the Response is delay by exactly 1 KeepAliveInterval each +- 4000 bytes. For example, when I have set a 10 second KeepAliveInterval in the socket options and send 3000 bytes to the server the response is received in +-260ms which is a normal latency. If I sent 4500 bytes the response is received in +-10260ms and if I sent 8500 bytes it is 20260ms.
Initially I figured this was something on Binances side but they told me this only seems to happen with the Dotnet socket implementation and that there might be an issue on the client side with that.
Thread discussing this with Binance: https://dev.binance.vision/t/socket-live-subscribing-server-delay/9645
Gist for reproducing the issue: https://gist.github.com/JKorf/afd5bd11f49670b85031df962f37b468
Reproduction Steps
Have a ClientWebsocket and change the KeepAliveInterval while sending a request > 4000 bytes to the server. See gist
https://gist.github.com/JKorf/afd5bd11f49670b85031df962f37b468
Expected behavior
Expected not to have the KeepAliveInterval have any influence on the response time
Actual behavior
Response is delay by KeepAliveInterval
Regression?
No response
Known Workarounds
Sending < 4000 bytes doesn't have the issue
Configuration
Dotnet 6 Windows 10 X64
Other information
No response