1
0
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:
Jkorf
2021-09-22 14:12:49 +02:00
parent 41b58ed284
commit 1b4ca864ed
2 changed files with 157 additions and 0 deletions
@@ -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)
{