From 8b1f9af45877ae68e639d7ff5d2e15bd5b97aee6 Mon Sep 17 00:00:00 2001 From: Jan Korf Date: Thu, 22 Nov 2018 22:03:01 +0100 Subject: [PATCH] socket events virtual instead of abstract --- CryptoExchange.Net/SocketClient.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/CryptoExchange.Net/SocketClient.cs b/CryptoExchange.Net/SocketClient.cs index 4d09e5f..3a78224 100644 --- a/CryptoExchange.Net/SocketClient.cs +++ b/CryptoExchange.Net/SocketClient.cs @@ -42,6 +42,10 @@ namespace CryptoExchange.Net reconnectInterval = exchangeOptions.ReconnectInterval; } + /// + /// Set a function to interprete the data, used when the data is received as bytes instead of a string + /// + /// protected void SetDataInterpreter(Func 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 ConnectSocket(IWebsocket socket)