The following code in WebSocketServerTransport.cs results in some of the empty messages being skipped.
// Do a 0 byte read so that idle connections don't allocate a buffer when waiting for a read
var result = await socket.ReceiveAsync(Memory<byte>.Empty, token);
if (result.MessageType == WebSocketMessageType.Close)
{
_gracefulClose = true;
return;
}
The following code in
WebSocketServerTransport.cs
results in some of the empty messages being skipped.Steps to reproduce