Close the WebSocket when disconnecting

This resolves #224
This commit is contained in:
Christopher F
2016-11-25 21:45:56 -05:00
parent 8ec80663f0
commit 58291f8199

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;
}