Skip to content

Commit 123f670

Browse files
committed
avoid crash
1 parent 30fc6b2 commit 123f670

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/SocketIOClient/Transport/TransportRouter.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,14 @@ public async Task DisconnectAsync()
216216
}
217217
else
218218
{
219-
await _clientWebSocket.CloseAsync(WebSocketCloseStatus.NormalClosure, string.Empty, CancellationToken.None).ConfigureAwait(false);
219+
try
220+
{
221+
await _clientWebSocket.CloseAsync(WebSocketCloseStatus.NormalClosure, string.Empty, CancellationToken.None).ConfigureAwait(false);
222+
}
223+
catch (Exception e)
224+
{
225+
Debug.WriteLine(e);
226+
}
220227
_clientWebSocket.Dispose();
221228
}
222229
}

0 commit comments

Comments
 (0)