mirror of
https://github.com/JKorf/CryptoExchange.Net
synced 2025-07-08 15:16:15 +00:00
Compare commits
5 Commits
5c41ef1ee4
...
892e8a4508
Author | SHA1 | Date | |
---|---|---|---|
|
892e8a4508 | ||
|
8336d373f3 | ||
|
71072680a8 | ||
|
e13f105019 | ||
|
401577451e |
@ -220,7 +220,7 @@ namespace CryptoExchange.Net
|
||||
|
||||
_log.Write(LogLevel.Information, $"[{requestId}] Creating request for " + uri);
|
||||
var paramsPosition = parameterPosition ?? ParameterPositions[method];
|
||||
var request = ConstructRequest(uri, method, parameters, signed, paramsPosition, arraySerialization ?? this.arraySerialization, requestId, additionalHeaders);
|
||||
var request = ConstructRequest(uri, method, parameters?.OrderBy(p => p.Key).ToDictionary(p => p.Key, p => p.Value), signed, paramsPosition, arraySerialization ?? this.arraySerialization, requestId, additionalHeaders);
|
||||
|
||||
string? paramString = "";
|
||||
if (paramsPosition == HttpMethodParameterPosition.InBody)
|
||||
|
@ -6,16 +6,16 @@
|
||||
<PackageId>CryptoExchange.Net</PackageId>
|
||||
<Authors>JKorf</Authors>
|
||||
<Description>A base package for implementing cryptocurrency API's</Description>
|
||||
<PackageVersion>5.3.0</PackageVersion>
|
||||
<AssemblyVersion>5.3.0</AssemblyVersion>
|
||||
<FileVersion>5.3.0</FileVersion>
|
||||
<PackageVersion>5.3.1</PackageVersion>
|
||||
<AssemblyVersion>5.3.1</AssemblyVersion>
|
||||
<FileVersion>5.3.1</FileVersion>
|
||||
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
|
||||
<RepositoryType>git</RepositoryType>
|
||||
<RepositoryUrl>https://github.com/JKorf/CryptoExchange.Net.git</RepositoryUrl>
|
||||
<PackageProjectUrl>https://github.com/JKorf/CryptoExchange.Net</PackageProjectUrl>
|
||||
<NeutralLanguage>en</NeutralLanguage>
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
<PackageReleaseNotes>5.3.0 - Reworked client architecture, shifting funcationality to the ApiClient, Fixed ArrayConverter exponent parsing, Fixed ArrayConverter not checking null, Added optional delay setting after establishing socket connection, Added callback for revitalizing a socket request when reconnecting, Fixed proxy setting websocket</PackageReleaseNotes>
|
||||
<PackageReleaseNotes>5.3.1 - Added default request parameter ordering before applying authentication, Fixed possible issue where a socket would reconnect when it should close if it was already in reconnecting</PackageReleaseNotes>
|
||||
<Nullable>enable</Nullable>
|
||||
<LangVersion>9.0</LangVersion>
|
||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||
|
@ -271,7 +271,7 @@ namespace CryptoExchange.Net.Objects
|
||||
/// <summary>
|
||||
/// The time to wait after connecting a socket before sending messages. Can be used for API's which will rate limit if you subscribe directly after connecting.
|
||||
/// </summary>
|
||||
public TimeSpan DelayAfterConnect = TimeSpan.Zero;
|
||||
public TimeSpan DelayAfterConnect { get; set; } = TimeSpan.Zero;
|
||||
|
||||
/// <summary>
|
||||
/// ctor
|
||||
@ -305,6 +305,7 @@ namespace CryptoExchange.Net.Objects
|
||||
SocketNoDataTimeout = baseOptions.SocketNoDataTimeout;
|
||||
SocketSubscriptionsCombineTarget = baseOptions.SocketSubscriptionsCombineTarget;
|
||||
MaxSocketConnections = baseOptions.MaxSocketConnections;
|
||||
DelayAfterConnect = baseOptions.DelayAfterConnect;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
@ -293,17 +293,17 @@ namespace CryptoExchange.Net.Sockets
|
||||
public virtual async Task CloseAsync()
|
||||
{
|
||||
await _closeSem.WaitAsync().ConfigureAwait(false);
|
||||
_stopRequested = true;
|
||||
|
||||
try
|
||||
{
|
||||
if (_closeTask != null && !_closeTask.IsCompleted)
|
||||
if (_closeTask?.IsCompleted == false)
|
||||
{
|
||||
_log.Write(LogLevel.Debug, $"Socket {Id} CloseAsync() waiting for existing close task");
|
||||
await _closeTask.ConfigureAwait(false);
|
||||
return;
|
||||
}
|
||||
|
||||
_stopRequested = true;
|
||||
|
||||
if (!IsOpen)
|
||||
{
|
||||
_log.Write(LogLevel.Debug, $"Socket {Id} CloseAsync() socket not open");
|
||||
@ -430,7 +430,8 @@ namespace CryptoExchange.Net.Sockets
|
||||
{
|
||||
// Connection closed unexpectedly, .NET framework
|
||||
OnError?.Invoke(ioe);
|
||||
_closeTask = CloseInternalAsync();
|
||||
if (_closeTask?.IsCompleted != false)
|
||||
_closeTask = CloseInternalAsync();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -441,6 +442,7 @@ namespace CryptoExchange.Net.Sockets
|
||||
// Because this is running in a separate task and not awaited until the socket gets closed
|
||||
// any exception here will crash the send processing, but do so silently unless the socket get's stopped.
|
||||
// Make sure we at least let the owner know there was an error
|
||||
_log.Write(LogLevel.Warning, $"Socket {Id} Send loop stopped with exception");
|
||||
OnError?.Invoke(e);
|
||||
throw;
|
||||
}
|
||||
@ -486,7 +488,8 @@ namespace CryptoExchange.Net.Sockets
|
||||
{
|
||||
// Connection closed unexpectedly
|
||||
OnError?.Invoke(wse);
|
||||
_closeTask = CloseInternalAsync();
|
||||
if (_closeTask?.IsCompleted != false)
|
||||
_closeTask = CloseInternalAsync();
|
||||
break;
|
||||
}
|
||||
|
||||
@ -494,7 +497,8 @@ namespace CryptoExchange.Net.Sockets
|
||||
{
|
||||
// Connection closed unexpectedly
|
||||
_log.Write(LogLevel.Debug, $"Socket {Id} received `Close` message");
|
||||
_closeTask = CloseInternalAsync();
|
||||
if (_closeTask?.IsCompleted != false)
|
||||
_closeTask = CloseInternalAsync();
|
||||
break;
|
||||
}
|
||||
|
||||
@ -559,6 +563,7 @@ namespace CryptoExchange.Net.Sockets
|
||||
// Because this is running in a separate task and not awaited until the socket gets closed
|
||||
// any exception here will crash the receive processing, but do so silently unless the socket gets stopped.
|
||||
// Make sure we at least let the owner know there was an error
|
||||
_log.Write(LogLevel.Warning, $"Socket {Id} Receive loop stopped with exception");
|
||||
OnError?.Invoke(e);
|
||||
throw;
|
||||
}
|
||||
|
@ -33,6 +33,10 @@ 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 5.3.1 - 08 Dec 2022
|
||||
* Added default request parameter ordering before applying authentication
|
||||
* Fixed possible issue where a socket would reconnect when it should close if it was already in reconnecting
|
||||
|
||||
* Version 5.3.0 - 14 Nov 2022
|
||||
* Reworked client architecture, shifting funcationality to the ApiClient
|
||||
* Fixed ArrayConverter exponent parsing
|
||||
|
Loading…
x
Reference in New Issue
Block a user