diff --git a/System.Net.WebSockets.Client.Managed/ManagedWebSocket.cs b/System.Net.WebSockets.Client.Managed/ManagedWebSocket.cs index f201e65..332f565 100644 --- a/System.Net.WebSockets.Client.Managed/ManagedWebSocket.cs +++ b/System.Net.WebSockets.Client.Managed/ManagedWebSocket.cs @@ -731,14 +731,7 @@ private async Task ReceiveAsyncPrivate(ArraySegment(payloadBuffer.Array, payloadBuffer.Offset, bytesToCopy), header.Fin && header.PayloadLength == 0, _utf8TextState))) { - var data = new byte[bytesToCopy]; - for (int i = 0; i < bytesToCopy; i++) - data[i] = payloadBuffer.Array[payloadBuffer.Offset + i]; - - File.WriteAllBytes(@$"D:\Temp\Websocket\Dump{DateTime.UtcNow.Ticks}_{_dumpNext}.bin", data); - - _dumpNext = !_dumpNext; - //await CloseWithReceiveErrorAndThrowAsync(WebSocketCloseStatus.InvalidPayloadData, WebSocketError.Faulted, cancellationToken).ConfigureAwait(false); + await CloseWithReceiveErrorAndThrowAsync(WebSocketCloseStatus.InvalidPayloadData, WebSocketError.Faulted, cancellationToken).ConfigureAwait(false); } _lastReceiveHeader = header;