1
0
mirror of https://github.com/JKorf/CryptoExchange.Net synced 2025-06-09 17:06:19 +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
commit b708ad3a1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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