mirror of
https://github.com/JKorf/CryptoExchange.Net.git
synced 2026-08-20 12:53:02 +00:00
Fixed websocket not reconnecting on .NetFramework when connection unexpectedly gets closed
This commit is contained in:
@@ -384,6 +384,13 @@ namespace CryptoExchange.Net.Sockets
|
||||
// cancelled
|
||||
break;
|
||||
}
|
||||
catch (IOException ioe)
|
||||
{
|
||||
// Connection closed unexpectedly, .NET framework
|
||||
Handle(errorHandlers, ioe);
|
||||
await CloseInternalAsync(false, true).ConfigureAwait(false);
|
||||
break;
|
||||
}
|
||||
catch (WebSocketException wse)
|
||||
{
|
||||
// Connection closed unexpectedly
|
||||
@@ -432,6 +439,13 @@ namespace CryptoExchange.Net.Sockets
|
||||
await CloseInternalAsync(true, false).ConfigureAwait(false);
|
||||
break;
|
||||
}
|
||||
catch (IOException ioe)
|
||||
{
|
||||
// Connection closed unexpectedly, .NET framework
|
||||
Handle(errorHandlers, ioe);
|
||||
await CloseInternalAsync(true, false).ConfigureAwait(false);
|
||||
break;
|
||||
}
|
||||
|
||||
if (receiveResult.MessageType == WebSocketMessageType.Close)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user