Class HeartbeatTimeoutException
- Namespace
- DatabentoDotNet.Live
- Assembly
- DatabentoDotNet.Live.dll
No bytes arrived from the live gateway within EffectiveReadTimeout.
public sealed class HeartbeatTimeoutException : LiveException, ISerializable
- Inheritance
-
HeartbeatTimeoutException
- Implements
- Inherited Members
Remarks
Port of upstream's Error::HeartbeatTimeout (live/client.rs), and it keeps the
upstream name even though the budget it reports is
ReadTimeout — because the name is the explanation. A silent socket
is only evidence of a problem because the gateway promises not to be silent. It emits a
SystemMsg heartbeat whenever nothing else is due, so a gap longer than that interval
means the connection is dead rather than the market is quiet. Without that promise, thirty-five
seconds without a trade at 3am would be perfectly ordinary and no read timeout could be
justified at all. Calling this a ReadTimeoutException would name the mechanism and hide
the reason.
The connection is spent when this is raised. IsClosed is set and the socket is torn down, matching upstream, which marks itself closed and requires a reconnect rather than retrying. There is no way to abandon a pending socket read in .NET without disposing the socket, so the timeout could not be non-destructive even if the protocol allowed it.
Constructors
HeartbeatTimeoutException()
Creates the exception with no message.
public HeartbeatTimeoutException()
HeartbeatTimeoutException(Duration, string)
Creates the exception for a budget that elapsed.
public HeartbeatTimeoutException(Duration timeout, string waitingFor)
Parameters
timeoutDurationThe budget that elapsed.
waitingForstringWhat the client was waiting for, in words — "the session metadata", "the next record". It is the difference between a gateway that never started the session and one that started it and then went quiet, which is otherwise invisible from the message alone.
HeartbeatTimeoutException(string)
Creates the exception with a message.
public HeartbeatTimeoutException(string message)
Parameters
messagestringThe message.
HeartbeatTimeoutException(string, Exception)
Creates the exception with a message and an underlying cause.
public HeartbeatTimeoutException(string message, Exception innerException)
Parameters
Properties
Timeout
The read budget that elapsed.
public Duration Timeout { get; }