Property PreRequestTimeout
- Assembly
- WhalesSecret.TradeScriptLib.dll
PreRequestTimeout
Maximum time until the request is sent to the exchange.
public TimeSpan PreRequestTimeout { get; }
Property Value
Remarks
Note that this timeout period does not limit the request itself. It rather limits the cumulative amount of time before the request is sent to the exchange. The strategy was intentionally designed in this way to avoid timing out when a request was sent to its destination exchange. Such cases are hard to recover from because it's not immediately clear if the request was canceled in time or if it reached its destination and was processed by the exchange.
For example, if a request is to be sent with 15 seconds timeout and the client is currently disconnected and does not reconnect within 15 seconds, the call fails because of this timeout.
If a request is to be sent with 15 seconds timeout and the client is currently disconnected but it manages to reconnect in 12 seconds and sends the request then, the call will not be cancelled even if the request itself takes more than 3 seconds. of this timeout.
If a request is to be sent with 15 seconds timeout and the client is currently disconnected but it manages to reconnect in 10 seconds, but the request fails in 1 second because the connection is interrupted again, due to the cumulative nature of this timeout, there are only 4 seconds left for the client to reconnect and send the request. Otherwise, it will fail due to this timeout.