mirror of
https://github.com/JKorf/CryptoExchange.Net
synced 2026-02-16 14:13:46 +00:00
Compare commits
No commits in common. "de0a954a914a77544ea8968d59ff5a7418ea3b59" and "40d480e1fca5bf65872536d1b251c275f77b6e81" have entirely different histories.
de0a954a91
...
40d480e1fc
@ -6,9 +6,9 @@
|
||||
<PackageId>CryptoExchange.Net</PackageId>
|
||||
<Authors>JKorf</Authors>
|
||||
<Description>CryptoExchange.Net is a base library which is used to implement different cryptocurrency (exchange) API's. It provides a standardized way of implementing different API's, which results in a very similar experience for users of the API implementations.</Description>
|
||||
<PackageVersion>10.4.0</PackageVersion>
|
||||
<AssemblyVersion>10.4.0</AssemblyVersion>
|
||||
<FileVersion>10.4.0</FileVersion>
|
||||
<PackageVersion>10.3.1</PackageVersion>
|
||||
<AssemblyVersion>10.3.1</AssemblyVersion>
|
||||
<FileVersion>10.3.1</FileVersion>
|
||||
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
|
||||
<PackageTags>OKX;OKX.Net;Mexc;Mexc.Net;Kucoin;Kucoin.Net;Kraken;Kraken.Net;Huobi;Huobi.Net;CoinEx;CoinEx.Net;Bybit;Bybit.Net;Bitget;Bitget.Net;Bitfinex;Bitfinex.Net;Binance;Binance.Net;CryptoCurrency;CryptoCurrency Exchange;CryptoExchange.Net</PackageTags>
|
||||
<RepositoryType>git</RepositoryType>
|
||||
|
||||
@ -53,57 +53,41 @@ namespace CryptoExchange.Net.Objects
|
||||
_waiters.Enqueue(tcs);
|
||||
}
|
||||
|
||||
CancellationTokenSource? delayCts = null;
|
||||
|
||||
try
|
||||
if (timeout.HasValue || ct.CanBeCanceled)
|
||||
{
|
||||
if (timeout.HasValue || ct.CanBeCanceled)
|
||||
// Wait for either timeout, cancellation token or set result
|
||||
var delayTask = Task.Delay(timeout ?? Timeout.InfiniteTimeSpan, ct);
|
||||
var completedTask = await Task.WhenAny(tcs.Task, delayTask).ConfigureAwait(false);
|
||||
|
||||
if (completedTask != tcs.Task)
|
||||
{
|
||||
delayCts = CancellationTokenSource.CreateLinkedTokenSource(ct);
|
||||
// This was a timeout or cancellation, need to remove tcs from waiters
|
||||
// if the tcs was set instead it will be removed in the Set method
|
||||
|
||||
var delayTask = Task.Delay(
|
||||
timeout ?? Timeout.InfiniteTimeSpan,
|
||||
delayCts.Token);
|
||||
|
||||
var completedTask =
|
||||
await Task.WhenAny(tcs.Task, delayTask)
|
||||
.ConfigureAwait(false);
|
||||
|
||||
if (completedTask != tcs.Task)
|
||||
if (tcs.TrySetResult(false))
|
||||
{
|
||||
// This was a timeout or cancellation, need to remove tcs from waiters
|
||||
// if the tcs was set instead it will be removed in the Set method
|
||||
if (tcs.TrySetResult(false))
|
||||
lock (_waitersLock)
|
||||
{
|
||||
lock (_waitersLock)
|
||||
// Dequeue and put in the back of the queue again except for the one we need to remove
|
||||
int count = _waiters.Count;
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
// Dequeue and put in the back of the queue again except for the one we need to remove
|
||||
int count = _waiters.Count;
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
var w = _waiters.Dequeue();
|
||||
if (w != tcs)
|
||||
_waiters.Enqueue(w);
|
||||
}
|
||||
var w = _waiters.Dequeue();
|
||||
if (w != tcs)
|
||||
_waiters.Enqueue(w);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
await tcs.Task.ConfigureAwait(false);
|
||||
}
|
||||
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
finally
|
||||
else
|
||||
{
|
||||
// Actively stop the delay if tcs.Task won
|
||||
delayCts?.Cancel();
|
||||
delayCts?.Dispose();
|
||||
await tcs.Task.ConfigureAwait(false);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
16
README.md
16
README.md
@ -67,22 +67,6 @@ Make a one time donation in a crypto currency of your choice. If you prefer to d
|
||||
Alternatively, sponsor me on Github using [Github Sponsors](https://github.com/sponsors/JKorf).
|
||||
|
||||
## Release notes
|
||||
* Version 10.4.0 - 06 Feb 2026
|
||||
* Added user data tracking logic
|
||||
* Added LastReceiveTime, SocketStatus and SubscriptionStatus properties to UpdateSubscription
|
||||
* Added SharedTransferStatus Enum and property to SharedDeposit
|
||||
* Added PositionMode property to SharedPosition model
|
||||
* Added IsZero property to SharedQuantity
|
||||
* Added additional methods for requesting supported symbols to Shared ISpotSymbolRestClient/IFuturesSymbolRestClient interfaces
|
||||
* Added Disposed property on BaseClient and IRestClient/ISocketClient interfaces
|
||||
* Added AutoTimestamp option for socket client
|
||||
* Renamed IWebSocket LastActionTime to LastReceiveTime
|
||||
* Refactored AsyncResetEvent implementation
|
||||
* Updated CryptoExchangeWebsocketClient LastReceiveTime logic
|
||||
* Updated Subscription status change event handler to run sync instead of separate task
|
||||
* Updated Interval property access on KlineTracker to public
|
||||
* Fixed socket client timestamp offset bug
|
||||
|
||||
* Version 10.3.1 - 27 Jan 2026
|
||||
* Fixed potential collection modified exception upon logging message not handled in websocket message handling
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user