mirror of
https://github.com/JKorf/CryptoExchange.Net.git
synced 2026-11-03 16:57:44 +00:00
41 lines
1.6 KiB
C#
41 lines
1.6 KiB
C#
using CryptoExchange.Net.Authentication;
|
|
using System;
|
|
|
|
namespace CryptoExchange.Net.Objects.Options
|
|
{
|
|
/// <summary>
|
|
/// Socket api options
|
|
/// </summary>
|
|
public class SocketApiOptions : ApiOptions
|
|
{
|
|
/// <summary>
|
|
/// The max time of not receiving any data after which the connection is assumed to be dropped. This can only be used for socket connections where a steady flow of data is expected,
|
|
/// for example when the server sends intermittent ping requests
|
|
/// </summary>
|
|
public TimeSpan? SocketNoDataTimeout { get; set; }
|
|
|
|
/// <summary>
|
|
/// The max amount of connections to make to the server. Can be used for API's which only allow a certain number of connections. Changing this to a high value might cause issues.
|
|
/// </summary>
|
|
public int? MaxSocketConnections { get; set; }
|
|
|
|
/// <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 { get; set; }
|
|
|
|
/// <summary>
|
|
/// Set the values of this options on the target options
|
|
/// </summary>
|
|
public T Set<T>(T item) where T : SocketApiOptions, new()
|
|
{
|
|
item.OutputOriginalData = OutputOriginalData;
|
|
item.SocketNoDataTimeout = SocketNoDataTimeout;
|
|
item.AutoTimestamp = AutoTimestamp;
|
|
item.MaxSocketConnections = MaxSocketConnections;
|
|
item.DelayAfterConnect = DelayAfterConnect;
|
|
return item;
|
|
}
|
|
}
|
|
}
|