1
0
mirror of https://github.com/JKorf/CryptoExchange.Net.git synced 2026-08-20 12:53:02 +00:00

Added name to message handlers, added socket type to subscription for background sockets

This commit is contained in:
JKorf
2018-11-29 11:28:46 +01:00
parent 8611723c6f
commit 1b6e1f99f8
3 changed files with 26 additions and 3 deletions
@@ -16,12 +16,14 @@ namespace CryptoExchange.Net.Sockets
/// <summary>
/// Message handlers for this subscription. Should return true if the message is handled and should not be distributed to the other handlers
/// </summary>
public List<Func<SocketSubscription, JToken, bool>> MessageHandlers { get; set; }
public Dictionary<string, Func<SocketSubscription, JToken, bool>> MessageHandlers { get; set; }
public List<SocketEvent> Events { get; set; }
public IWebsocket Socket { get; set; }
public SocketRequest Request { get; set; }
public SocketType Type { get; set; }
private bool lostTriggered;
private List<SocketEvent> waitingForEvents;
@@ -32,7 +34,7 @@ namespace CryptoExchange.Net.Sockets
Events = new List<SocketEvent>();
waitingForEvents = new List<SocketEvent>();
MessageHandlers = new List<Func<SocketSubscription, JToken, bool>>();
MessageHandlers = new Dictionary<string, Func<SocketSubscription, JToken, bool>>();
Socket.OnClose += () =>
{