Merge pull request #378 from RogueException/issue/224

Close the WebSocket when disconnecting
This commit is contained in:
RogueException
2016-11-26 23:52:15 -04:00
committed by GitHub

View File

@@ -101,6 +101,8 @@ namespace Discord.Net.WebSockets
if (_client != null && _client.State == WebSocketState.Open)
{
var token = new CancellationToken();
await _client.CloseAsync(WebSocketCloseStatus.NormalClosure, "", token);
_client.Dispose();
_client = null;
}