Struct LiveControlState
The engine's control state, as carried by a ControlState frame. Sent right after the handshake, on every change and about once a second.
public readonly struct LiveControlState : IEquatable<LiveControlState>
- Implements
- Inherited Members
Constructors
LiveControlState(LiveRunState, LiveControlFlags, long, double, double, uint, uint, uint, string, double, LiveControlToken)
The engine's control state, as carried by a ControlState frame. Sent right after the handshake, on every change and about once a second.
public LiveControlState(LiveRunState RunState, LiveControlFlags Flags, long TickNumber, double Scale, double AchievedScale, uint StepsPending, uint LeaseMs, uint AckSeq, string Reason, double MaxTimeScale = 64, LiveControlToken Nonce = default)
Parameters
RunStateLiveRunStateThe engine's run state.
FlagsLiveControlFlagsAllowed / controller / terminal.
TickNumberlongThe engine's current tick number.
ScaledoubleThe requested time scale; PositiveInfinity means unpaced.
AchievedScaledoubleThe time scale measured over the engine's telemetry window.
StepsPendinguintSteps still to execute.
LeaseMsuintThe remote-hold lease, in milliseconds.
AckSequintThe sequence number of the last command this state answers; 0 when none.
ReasonstringWhy control is not allowed, or why the acknowledged command (or the hello) was refused, or empty.
MaxTimeScaledoubleThe engine's
RuntimeOptions.MaxTimeScale: it accepts a time scale in [1/max, max], or +∞.NonceLiveControlTokenThis connection's challenge: 32 random bytes, fresh per connection, the same in every state it sends. The hello answers it with ComputeHelloMac(in LiveControlToken, in LiveControlToken), so the token itself never travels and a captured hello cannot be replayed on another connection. All zero when control is off.
Properties
AchievedScale
The time scale measured over the engine's telemetry window.
public double AchievedScale { get; init; }
Property Value
AckSeq
The sequence number of the last command this state answers; 0 when none.
public uint AckSeq { get; init; }
Property Value
Flags
Allowed / controller / terminal.
public LiveControlFlags Flags { get; init; }
Property Value
IsAllowed
The engine accepts control on this connection.
public bool IsAllowed { get; }
Property Value
IsBadToken
This state answers a hello whose proof matched no token.
public bool IsBadToken { get; }
Property Value
IsController
This connection is the authenticated controller.
public bool IsController { get; }
Property Value
IsOff
Control is off by configuration: the opt-in default.
public bool IsOff { get; }
Property Value
IsRefused
The acknowledged command was refused; Reason says why.
public bool IsRefused { get; }
Property Value
IsRemoteHold
The engine is held by this controller's own, still-unchanged hold.
public bool IsRemoteHold { get; }
Property Value
IsTerminal
The run state is terminal.
public bool IsTerminal { get; }
Property Value
LeaseMs
The remote-hold lease, in milliseconds.
public uint LeaseMs { get; init; }
Property Value
MaxTimeScale
The engine's RuntimeOptions.MaxTimeScale: it accepts a time scale in [1/max, max], or +∞.
public double MaxTimeScale { get; init; }
Property Value
Nonce
This connection's challenge: 32 random bytes, fresh per connection, the same in every state it sends. The hello answers it with ComputeHelloMac(in LiveControlToken, in LiveControlToken), so the token itself never travels and a captured hello cannot be replayed on another connection. All zero when control is off.
public LiveControlToken Nonce { get; init; }
Property Value
Reason
Why control is not allowed, or why the acknowledged command (or the hello) was refused, or empty.
public string Reason { get; init; }
Property Value
RunState
The engine's run state.
public LiveRunState RunState { get; init; }
Property Value
Scale
The requested time scale; PositiveInfinity means unpaced.
public double Scale { get; init; }
Property Value
StepsPending
Steps still to execute.
public uint StepsPending { get; init; }
Property Value
TickNumber
The engine's current tick number.
public long TickNumber { get; init; }
Property Value
Methods
Deconstruct(out LiveRunState, out LiveControlFlags, out long, out double, out double, out uint, out uint, out uint, out string, out double, out LiveControlToken)
public void Deconstruct(out LiveRunState RunState, out LiveControlFlags Flags, out long TickNumber, out double Scale, out double AchievedScale, out uint StepsPending, out uint LeaseMs, out uint AckSeq, out string Reason, out double MaxTimeScale, out LiveControlToken Nonce)
Parameters
RunStateLiveRunStateFlagsLiveControlFlagsTickNumberlongScaledoubleAchievedScaledoubleStepsPendinguintLeaseMsuintAckSequintReasonstringMaxTimeScaledoubleNonceLiveControlToken
Equals(object)
public override bool Equals(object obj)
Parameters
objobject
Returns
Equals(LiveControlState)
public bool Equals(LiveControlState other)
Parameters
otherLiveControlState
Returns
GetHashCode()
public override int GetHashCode()
Returns
ToString()
public override string ToString()
Returns
Operators
operator ==(LiveControlState, LiveControlState)
public static bool operator ==(LiveControlState left, LiveControlState right)
Parameters
leftLiveControlStaterightLiveControlState
Returns
operator !=(LiveControlState, LiveControlState)
public static bool operator !=(LiveControlState left, LiveControlState right)
Parameters
leftLiveControlStaterightLiveControlState