Class ConnectionState
- Namespace
- RDCore.SDK.Client.Connection
- Assembly
- RDCore.SDK.dll
The base ConnectionState abstraction. One record per state, mirroring
RDCore.SDK.Server.Services.States.ServerState.
public abstract record ConnectionState : IEquatable<ConnectionState>
- Inheritance
-
ConnectionState
- Implements
- Derived
- Inherited Members
Constructors
ConnectionState(ConnectionStateValue)
The base ConnectionState abstraction. One record per state, mirroring
RDCore.SDK.Server.Services.States.ServerState.
protected ConnectionState(ConnectionStateValue Value)
Parameters
ValueConnectionStateValueThe ConnectionStateValue this state represents.
Properties
Connecting
The process is alive; the transport is connecting.
public static ConnectionState Connecting { get; }
Property Value
Exited
The child process has exited. Terminal.
public static ConnectionState Exited { get; }
Property Value
Initializing
The transport is connected; the LSP initialization handshake is running.
public static ConnectionState Initializing { get; }
Property Value
IsTerminal
Whether the connection has reached a terminal state and will not recover.
public bool IsTerminal { get; }
Property Value
IsUsable
Whether a request or notification may be sent over the connection.
public bool IsUsable { get; }
Property Value
NotStarted
The initial state: nothing started.
public static ConnectionState NotStarted { get; }
Property Value
Ready
The connection is initialized and usable.
public static ConnectionState Ready { get; }
Property Value
ShuttingDown
A graceful shutdown handshake is in progress.
public static ConnectionState ShuttingDown { get; }
Property Value
Spawning
The child process is being started.
public static ConnectionState Spawning { get; }
Property Value
Value
The ConnectionStateValue this state represents.
public ConnectionStateValue Value { get; init; }
Property Value
Methods
AdvanceTo(ConnectionState)
Returns target if the transition from this state is legal, otherwise throws.
public ConnectionState AdvanceTo(ConnectionState target)
Parameters
targetConnectionStateThe state to transition to.
Returns
- ConnectionState
target, when the transition is legal.
Exceptions
- InvalidConnectionStateException
The transition from this state to
targetis not legal.
CanAdvanceTo(ConnectionStateValue)
Whether a transition from this state to target is legal.
public bool CanAdvanceTo(ConnectionStateValue target)
Parameters
targetConnectionStateValueThe candidate next state.
Returns
Faulted(string)
The connection has failed unexpectedly.
public static ConnectionState Faulted(string reason)
Parameters
reasonstringA short description of what went wrong.
Returns
- ConnectionState
A FaultedConnectionState carrying
reason.