mirror of
https://github.com/JKorf/CryptoExchange.Net.git
synced 2026-08-14 18:02:58 +00:00
Socket client update, added headers to rest result
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
using System.Net;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net;
|
||||
|
||||
namespace CryptoExchange.Net.Objects
|
||||
{
|
||||
@@ -31,9 +33,21 @@ namespace CryptoExchange.Net.Objects
|
||||
/// </summary>
|
||||
public HttpStatusCode? ResponseStatusCode { get; set; }
|
||||
|
||||
public WebCallResult(HttpStatusCode? code, T data, Error error): base(data, error)
|
||||
public IEnumerable<Tuple<string, string>> ResponseHeaders { get; set; }
|
||||
|
||||
public WebCallResult(HttpStatusCode? code, IEnumerable<Tuple<string, string>> responseHeaders, T data, Error error): base(data, error)
|
||||
{
|
||||
ResponseHeaders = responseHeaders;
|
||||
ResponseStatusCode = code;
|
||||
}
|
||||
|
||||
public static WebCallResult<T> CreateErrorResult(Error error)
|
||||
{
|
||||
return new WebCallResult<T>(null, null, default(T), error);
|
||||
}
|
||||
public static WebCallResult<T> CreateErrorResult(HttpStatusCode? code, IEnumerable<Tuple<string, string>> responseHeaders, Error error)
|
||||
{
|
||||
return new WebCallResult<T>(code, responseHeaders, default(T), error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,6 +97,12 @@ namespace CryptoExchange.Net.Objects
|
||||
/// </summary>
|
||||
public TimeSpan SocketNoDataTimeout { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The amount of subscriptions that should be made on a single socket connection. Not all exchanges support multiple subscriptions on a single socket.
|
||||
/// Setting this to a higher number increases subscription speed, but having more subscriptions on a single connection will also increase the amount of traffic on that single connection.
|
||||
/// </summary>
|
||||
public int? SocketSubscriptionsCombineTarget { get; set; }
|
||||
|
||||
public T Copy<T>() where T : SocketClientOptions, new()
|
||||
{
|
||||
var copy = new T
|
||||
@@ -107,7 +113,8 @@ namespace CryptoExchange.Net.Objects
|
||||
LogWriters = LogWriters,
|
||||
AutoReconnect = AutoReconnect,
|
||||
ReconnectInterval = ReconnectInterval,
|
||||
SocketResponseTimeout = SocketResponseTimeout
|
||||
SocketResponseTimeout = SocketResponseTimeout,
|
||||
SocketSubscriptionsCombineTarget = SocketSubscriptionsCombineTarget
|
||||
};
|
||||
|
||||
if (ApiCredentials != null)
|
||||
|
||||
Reference in New Issue
Block a user