1
0
mirror of https://github.com/JKorf/CryptoExchange.Net.git synced 2026-08-14 18:02:58 +00:00
This commit is contained in:
Artem Kurianov
2020-08-20 16:47:42 +00:00
5 changed files with 222 additions and 47 deletions
+16 -3
View File
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Net.Http;
using CryptoExchange.Net.Authentication;
using CryptoExchange.Net.Interfaces;
using CryptoExchange.Net.Logging;
@@ -128,7 +129,10 @@ namespace CryptoExchange.Net.Objects
/// The time the server has to respond to a request before timing out
/// </summary>
public TimeSpan RequestTimeout { get; set; } = TimeSpan.FromSeconds(30);
/// <summary>
/// http client
/// </summary>
public HttpClient? HttpClient;
/// <summary>
/// ctor
/// </summary>
@@ -136,7 +140,15 @@ namespace CryptoExchange.Net.Objects
public RestClientOptions(string baseAddress): base(baseAddress)
{
}
/// <summary>
/// ctor
/// </summary>
/// <param name="baseAddress"></param>
/// <param name="httpClient">Shared http client</param>
public RestClientOptions(HttpClient httpClient, string baseAddress) : base(baseAddress)
{
HttpClient = httpClient;
}
/// <summary>
/// Create a copy of the options
/// </summary>
@@ -152,7 +164,8 @@ namespace CryptoExchange.Net.Objects
LogWriters = LogWriters,
RateLimiters = RateLimiters,
RateLimitingBehaviour = RateLimitingBehaviour,
RequestTimeout = RequestTimeout
RequestTimeout = RequestTimeout,
HttpClient = HttpClient
};
if (ApiCredentials != null)