diff --git a/websocket-sharp/Net/WebSockets/TcpListenerWebSocketContext.cs b/websocket-sharp/Net/WebSockets/TcpListenerWebSocketContext.cs index 3933cbe2..d4b19671 100644 --- a/websocket-sharp/Net/WebSockets/TcpListenerWebSocketContext.cs +++ b/websocket-sharp/Net/WebSockets/TcpListenerWebSocketContext.cs @@ -491,8 +491,10 @@ namespace WebSocketSharp.Net.WebSockets internal void SendAuthenticationChallenge (string challenge) { - var buff = HttpResponse.CreateUnauthorizedResponse (challenge).ToByteArray (); - _stream.Write (buff, 0, buff.Length); + var res = HttpResponse.CreateUnauthorizedResponse (challenge); + var bytes = res.ToByteArray (); + _stream.Write (bytes, 0, bytes.Length); + _request = HttpRequest.Read (_stream, 15000); }