diff --git a/src/Websocket.Client/WebsocketClient.cs b/src/Websocket.Client/WebsocketClient.cs index 8b4c898..a7b6842 100644 --- a/src/Websocket.Client/WebsocketClient.cs +++ b/src/Websocket.Client/WebsocketClient.cs @@ -476,7 +476,7 @@ private async Task Listen(WebSocket client, CancellationToken token) if (result.MessageType == WebSocketMessageType.Text && IsTextMessageConversionEnabled) { - var data = GetEncoding().GetString(ms.ToArray()); + var data = GetEncoding().GetString(ms.GetBuffer(), 0, (int)ms.Length); message = ResponseMessage.TextMessage(data); } else if (result.MessageType == WebSocketMessageType.Close)