mirror of
https://github.com/JKorf/CryptoExchange.Net.git
synced 2026-08-20 04:42:57 +00:00
Added ConnectionClosed event for when no reconnecting is happening
This commit is contained in:
@@ -247,11 +247,16 @@ namespace CryptoExchange.Net.OrderBook
|
||||
subscription = startResult.Data;
|
||||
subscription.ConnectionLost += () =>
|
||||
{
|
||||
|
||||
log.Write(LogLevel.Warning, $"{Id} order book {Symbol} connection lost");
|
||||
Status = OrderBookStatus.Reconnecting;
|
||||
Reset();
|
||||
};
|
||||
subscription.ConnectionClosed += () =>
|
||||
{
|
||||
log.Write(LogLevel.Warning, $"{Id} order book {Symbol} disconnected");
|
||||
Status = OrderBookStatus.Disconnected;
|
||||
StopAsync();
|
||||
};
|
||||
|
||||
subscription.ConnectionRestored += async time => await ResyncAsync().ConfigureAwait(false);
|
||||
Status = OrderBookStatus.Synced;
|
||||
@@ -336,6 +341,7 @@ namespace CryptoExchange.Net.OrderBook
|
||||
|
||||
if(subscription != null)
|
||||
await subscription.CloseAsync().ConfigureAwait(false);
|
||||
log.Write(LogLevel.Debug, $"{Id} order book {Symbol} stopped");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user