diff --git a/src/Microsoft.AspNetCore.Sockets/WebSockets.cs b/src/Microsoft.AspNetCore.Sockets/WebSockets.cs index 906c36fced..64fc41d402 100644 --- a/src/Microsoft.AspNetCore.Sockets/WebSockets.cs +++ b/src/Microsoft.AspNetCore.Sockets/WebSockets.cs @@ -54,14 +54,11 @@ namespace Microsoft.AspNetCore.Sockets { outputBuffer.Advance(result.Count); - if (result.EndOfMessage) - { - // Flush when we get an entire message - await outputBuffer.FlushAsync(); + // Flush the written data to the channel + await outputBuffer.FlushAsync(); - // Allocate a new buffer to further writing - outputBuffer = _channel.Input.Alloc(); - } + // Allocate a new buffer to further writing + outputBuffer = _channel.Input.Alloc(); } else {