1
0
mirror of https://github.com/JKorf/CryptoExchange.Net.git synced 2026-08-15 02:13:01 +00:00

Added optional delay after socket connection, added callback when reconnected socket to revitalize original request, fixed proxy setting socket

This commit is contained in:
JKorf
2022-11-13 19:47:33 +01:00
parent 3365837338
commit ad614830d1
5 changed files with 41 additions and 16 deletions
@@ -253,6 +253,7 @@ namespace CryptoExchange.Net.Sockets
var reconnectSuccessful = await ProcessReconnectAsync().ConfigureAwait(false);
if (!reconnectSuccessful)
{
_log.Write(LogLevel.Warning, "Failed reconnect processing, reconnecting again");
await _socket.ReconnectAsync().ConfigureAwait(false);
}
else
@@ -637,6 +638,16 @@ namespace CryptoExchange.Net.Sockets
}
}
foreach(var subscription in subscriptionList.Where(s => s.Request != null))
{
var result = await ApiClient.RevitalizeRequestAsync(subscription.Request!).ConfigureAwait(false);
if (!result)
{
_log.Write(LogLevel.Warning, "Failed request revitalization: " + result.Error);
return result.As<bool>(false);
}
}
// Foreach subscription which is subscribed by a subscription request we will need to resend that request to resubscribe
for (var i = 0; i < subscriptionList.Count; i += ApiClient.Options.MaxConcurrentResubscriptionsPerSocket)
{