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

added sub/unsub methods, added waiting for id event

This commit is contained in:
Jan Korf
2018-11-26 07:22:01 +01:00
parent b1085bc764
commit 5645e8e7f3
3 changed files with 24 additions and 0 deletions
@@ -6,6 +6,7 @@ namespace CryptoExchange.Net.Sockets
public class SocketEvent
{
public string Name { get; set; }
public int Id { get; set; }
private CallResult<bool> result;
private ManualResetEvent setEvnt;
@@ -64,6 +64,13 @@ namespace CryptoExchange.Net.Sockets
return Events.Single(e => e.Name == name).Wait();
}
public CallResult<bool> WaitForEvent(string name, int id)
{
var evnt = Events.Single(e => e.Name == name);
evnt.Id = id;
return evnt.Wait();
}
public async Task Close()
{
Socket.ShouldReconnect = false;