1
0
mirror of https://github.com/JKorf/CryptoExchange.Net.git synced 2026-08-20 21:02:55 +00:00

Merge pull request #97 from hkooiker/master

Fix disconnectTime in InvokeConnectionRestored
This commit is contained in:
Jan Korf
2021-06-07 09:28:51 +02:00
committed by GitHub
@@ -330,7 +330,7 @@ namespace CryptoExchange.Net.Sockets
if (lostTriggered) if (lostTriggered)
{ {
lostTriggered = false; lostTriggered = false;
InvokeConnectionRestored(); InvokeConnectionRestored(time);
} }
break; break;
@@ -351,9 +351,9 @@ namespace CryptoExchange.Net.Sockets
} }
} }
private async void InvokeConnectionRestored() private async void InvokeConnectionRestored(DateTime? disconnectTime)
{ {
await Task.Run(() => ConnectionRestored?.Invoke(DisconnectTime.HasValue ? DateTime.UtcNow - DisconnectTime.Value : TimeSpan.FromSeconds(0))).ConfigureAwait(false); await Task.Run(() => ConnectionRestored?.Invoke(disconnectTime.HasValue ? DateTime.UtcNow - disconnectTime.Value : TimeSpan.FromSeconds(0))).ConfigureAwait(false);
} }
private async Task<bool> ProcessReconnect() private async Task<bool> ProcessReconnect()