Merge pull request #378 from RogueException/issue/224
Close the WebSocket when disconnecting
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user