mirror of
https://github.com/JKorf/CryptoExchange.Net
synced 2025-06-11 01:46:12 +00:00
Changed WaitOne() to WaitOneAsync() in websocket send
This commit is contained in:
parent
98c948cf0a
commit
29ebd13958
@ -223,6 +223,16 @@ namespace CryptoExchange.Net
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Wait one async
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="handle"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static Task<bool> WaitOneAsync(this WaitHandle handle)
|
||||||
|
{
|
||||||
|
return handle.WaitOneAsync(-1, CancellationToken.None);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Wait one async
|
/// Wait one async
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -352,7 +352,7 @@ namespace CryptoExchange.Net.Sockets
|
|||||||
if (_closing)
|
if (_closing)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
_sendEvent.WaitOne();
|
await _sendEvent.WaitOneAsync().ConfigureAwait(false);
|
||||||
|
|
||||||
if (_closing)
|
if (_closing)
|
||||||
break;
|
break;
|
||||||
@ -365,7 +365,8 @@ namespace CryptoExchange.Net.Sockets
|
|||||||
DateTime? start = null;
|
DateTime? start = null;
|
||||||
while (MessagesSentLastSecond() >= RatelimitPerSecond)
|
while (MessagesSentLastSecond() >= RatelimitPerSecond)
|
||||||
{
|
{
|
||||||
start = DateTime.UtcNow;
|
if (start == null)
|
||||||
|
start = DateTime.UtcNow;
|
||||||
await Task.Delay(10).ConfigureAwait(false);
|
await Task.Delay(10).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user