1
0
mirror of https://github.com/JKorf/CryptoExchange.Net synced 2025-06-08 00:16:27 +00:00

socket events virtual instead of abstract

This commit is contained in:
Jan Korf 2018-11-22 22:03:01 +01:00
parent 2478e4c7c7
commit 8b1f9af458

View File

@ -42,6 +42,10 @@ namespace CryptoExchange.Net
reconnectInterval = exchangeOptions.ReconnectInterval;
}
/// <summary>
/// Set a function to interprete the data, used when the data is received as bytes instead of a string
/// </summary>
/// <param name="handler"></param>
protected void SetDataInterpreter(Func<byte[], string> handler)
{
dataInterpreter = handler;
@ -75,9 +79,9 @@ namespace CryptoExchange.Net
return socket;
}
protected abstract void SocketOpened(IWebsocket socket);
protected abstract void SocketClosed(IWebsocket socket);
protected abstract void SocketError(IWebsocket socket, Exception ex);
protected virtual void SocketOpened(IWebsocket socket) { }
protected virtual void SocketClosed(IWebsocket socket) { }
protected virtual void SocketError(IWebsocket socket, Exception ex) { }
protected abstract bool SocketReconnect(SocketSubscription socket, TimeSpan disconnectedTime);
protected virtual CallResult<SocketSubscription> ConnectSocket(IWebsocket socket)