mirror of
https://github.com/JKorf/CryptoExchange.Net.git
synced 2026-08-20 12:53:02 +00:00
Added exception event on socket subscription
This commit is contained in:
@@ -12,6 +12,7 @@ namespace CryptoExchange.Net.Sockets
|
||||
{
|
||||
public event Action ConnectionLost;
|
||||
public event Action<TimeSpan> ConnectionRestored;
|
||||
public event Action<Exception> Exception;
|
||||
|
||||
/// <summary>
|
||||
/// Message handlers for this subscription. Should return true if the message is handled and should not be distributed to the other handlers
|
||||
@@ -145,6 +146,11 @@ namespace CryptoExchange.Net.Sockets
|
||||
}
|
||||
}
|
||||
|
||||
public void InvokeExceptionHandler(Exception e)
|
||||
{
|
||||
Exception(e);
|
||||
}
|
||||
|
||||
public async Task Close()
|
||||
{
|
||||
Socket.ShouldReconnect = false;
|
||||
|
||||
@@ -25,6 +25,15 @@ namespace CryptoExchange.Net.Sockets
|
||||
remove => subscription.ConnectionRestored -= value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Event when an exception happened
|
||||
/// </summary>
|
||||
public event Action<Exception> Exception
|
||||
{
|
||||
add => subscription.Exception += value;
|
||||
remove => subscription.Exception -= value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The id of the socket
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user