[Modify] Polish it

This commit is contained in:
sta 2018-04-21 16:48:11 +09:00
parent f3d16101f5
commit e5accd3e69

View File

@ -481,7 +481,12 @@ namespace WebSocketSharp.Net.WebSockets
internal void Close (HttpStatusCode code) internal void Close (HttpStatusCode code)
{ {
_websocket.Close (HttpResponse.CreateCloseResponse (code)); var res = HttpResponse.CreateCloseResponse (code);
var bytes = res.ToByteArray ();
_stream.Write (bytes, 0, bytes.Length);
_stream.Close ();
_tcpClient.Close ();
} }
internal void SendAuthenticationChallenge (string challenge) internal void SendAuthenticationChallenge (string challenge)