Class NodeDisconnectedEventArgs
A node's websocket disconnected, or a startup that never connected gave up, or the supervision loop itself failed (the node stops reconnecting on its own, restart it manually), the same event covers all three, a manual stop raises no event.
public sealed class NodeDisconnectedEventArgs : EventArgs
- Inheritance
-
NodeDisconnectedEventArgs
- Inherited Members
Constructors
NodeDisconnectedEventArgs(WebSocketCloseStatus?, string?, bool, Exception?)
Initializes the event args with the reported values.
public NodeDisconnectedEventArgs(WebSocketCloseStatus? closeStatus, string? closeDescription, bool final, Exception? exception = null)
Parameters
closeStatusWebSocketCloseStatus?The status the websocket closed with, null when none.
closeDescriptionstringThe description the websocket closed with.
finalboolWhether this disconnect is final, false while the node still tries or could try to reconnect.
exceptionExceptionThe exception that best describes the disconnect, null when none is known.
Properties
CloseDescription
The close description the websocket reported.
public string? CloseDescription { get; }
Property Value
Remarks
On a Final disconnect it still describes the last websocket drop, not the reconnect failures that led the node to give up, Exception carries those.
May carry a library-generated abort reason instead (e.g. ready timeout) when the connection was
torn down locally, no server sent it.
CloseStatus
The close status the websocket reported, null when none.
public WebSocketCloseStatus? CloseStatus { get; }
Property Value
Remarks
The raw close code may not be a named member of WebSocketCloseStatus, servers and proxies may close with application-defined codes (4000-4999). On a Final disconnect it still describes the last websocket drop, not the reconnect failures that led the node to give up, Exception carries those.
Exception
The exception that best describes the disconnect, the websocket layer's for the drop, the library's ready-timeout when it tore the connection down locally (see CloseDescription), or the failure of the last reconnect attempt, the initial connect's when none ran, on a Final disconnect.
public Exception? Exception { get; }
Property Value
Remarks
Null when the websocket closed cleanly and no attempt failed.
Final
True when the node stopped reconnecting and is no longer connected, the last event of a reconnect give-up, of a failed startup, or of a supervision loop that failed.
public bool Final { get; }
Property Value
Remarks
Not absolute, the slot is free and a manual restart reconnects, and a manual stop during the backoff can end the reconnect loop without a final event.