Closed tcounts closed 4 years ago
Hi @tcounts!
All socket options are set via TcpTransport
properties. One of them is TcpTransport.NoDelay
which sets Socket.NoDelay.
You can configure TCP options with following code:
WebSocketListenerOptions.Transports.ConfigureTcp(tcp =>
{
tcp.BacklogSize = 100; // max pending connections waiting to be accepted
tcp.NoDelay = true;
tcp.ReceiveBufferSize = bufferSize;
tcp.SendBufferSize = bufferSize;
});
Thanks. I set the NoDelay, and that did not make a difference on what we were seeing, so Nagle does not appear to be the issue. Basically - we ALWAYS get the continuation frame packet even if the message is small enough to fit into a sing;e message.
If you want to write small message as single frame you could use WebSocketMessageWriteStream.WriteAndCloseAsync
method. Other approaches send at least 2 frames.
Thanks. I switched over to WebSocketMessageWriteStream.WriteAndCloseAsync
.
The WebSocket library appears to follow every initial data frame with a slightly-delayed (~40ms) empty continuation frame that has the Final bit set. We think this is related to the Nagle Algorithm being enabled.
The original vtortola implementation had an option to turn this off, but it has been removed this in your fork.
1) Is the continuation frame from the Nagle algorithm? 2) Is there a way to turn this off in this fork?