1
0
mirror of https://github.com/JKorf/CryptoExchange.Net synced 2025-06-09 17:06:19 +00:00

Fix disconnectTime in InvokeConnectionRestored

This commit is contained in:
Harmen Kooiker 2021-06-01 11:53:03 +02:00
parent b1f64bc8b1
commit 075e98a3ed

View File

@ -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()