Table of Contents

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

Value ConnectionStateValue

The ConnectionStateValue this state represents.

Properties

Connecting

The process is alive; the transport is connecting.

public static ConnectionState Connecting { get; }

Property Value

ConnectionState

Exited

The child process has exited. Terminal.

public static ConnectionState Exited { get; }

Property Value

ConnectionState

Initializing

The transport is connected; the LSP initialization handshake is running.

public static ConnectionState Initializing { get; }

Property Value

ConnectionState

IsTerminal

Whether the connection has reached a terminal state and will not recover.

public bool IsTerminal { get; }

Property Value

bool

IsUsable

Whether a request or notification may be sent over the connection.

public bool IsUsable { get; }

Property Value

bool

NotStarted

The initial state: nothing started.

public static ConnectionState NotStarted { get; }

Property Value

ConnectionState

Ready

The connection is initialized and usable.

public static ConnectionState Ready { get; }

Property Value

ConnectionState

ShuttingDown

A graceful shutdown handshake is in progress.

public static ConnectionState ShuttingDown { get; }

Property Value

ConnectionState

Spawning

The child process is being started.

public static ConnectionState Spawning { get; }

Property Value

ConnectionState

Value

The ConnectionStateValue this state represents.

public ConnectionStateValue Value { get; init; }

Property Value

ConnectionStateValue

Methods

AdvanceTo(ConnectionState)

Returns target if the transition from this state is legal, otherwise throws.

public ConnectionState AdvanceTo(ConnectionState target)

Parameters

target ConnectionState

The state to transition to.

Returns

ConnectionState

target, when the transition is legal.

Exceptions

InvalidConnectionStateException

The transition from this state to target is not legal.

CanAdvanceTo(ConnectionStateValue)

Whether a transition from this state to target is legal.

public bool CanAdvanceTo(ConnectionStateValue target)

Parameters

target ConnectionStateValue

The candidate next state.

Returns

bool

Faulted(string)

The connection has failed unexpectedly.

public static ConnectionState Faulted(string reason)

Parameters

reason string

A short description of what went wrong.

Returns

ConnectionState

A FaultedConnectionState carrying reason.