1
0
mirror of https://github.com/JKorf/CryptoExchange.Net synced 2026-02-16 14:13:46 +00:00

Added Disposed property on BaseClient and IRestClient/ISocketClient interfaces

This commit is contained in:
Jkorf 2026-02-02 09:33:47 +01:00
parent 2c63a83117
commit ba55705385
3 changed files with 17 additions and 0 deletions

View File

@ -39,6 +39,11 @@ namespace CryptoExchange.Net.Clients
/// </summary>
public string Exchange { get; }
/// <summary>
/// Whether client is disposed
/// </summary>
public bool Disposed { get; private set; }
/// <summary>
/// Api clients in this client
/// </summary>
@ -125,6 +130,8 @@ namespace CryptoExchange.Net.Clients
/// </summary>
public virtual void Dispose()
{
Disposed = true;
foreach (var client in ApiClients)
client.Dispose();
}

View File

@ -22,5 +22,10 @@ namespace CryptoExchange.Net.Interfaces.Clients
/// The exchange name
/// </summary>
string Exchange { get; }
/// <summary>
/// Whether client is disposed
/// </summary>
bool Disposed { get; }
}
}

View File

@ -35,6 +35,11 @@ namespace CryptoExchange.Net.Interfaces.Clients
/// </summary>
public int CurrentSubscriptions { get; }
/// <summary>
/// Whether client is disposed
/// </summary>
bool Disposed { get; }
/// <summary>
/// Unsubscribe from a stream using the subscription id received when starting the subscription
/// </summary>