Table of Contents

Struct LiveControlState

Namespace
Typhon.Profiler
Assembly
Typhon.Profiler.dll

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

RunState LiveRunState

The engine's run state.

Flags LiveControlFlags

Allowed / controller / terminal.

TickNumber long

The engine's current tick number.

Scale double

The requested time scale; PositiveInfinity means unpaced.

AchievedScale double

The time scale measured over the engine's telemetry window.

StepsPending uint

Steps still to execute.

LeaseMs uint

The remote-hold lease, in milliseconds.

AckSeq uint

The sequence number of the last command this state answers; 0 when none.

Reason string

Why control is not allowed, or why the acknowledged command (or the hello) was refused, or empty.

MaxTimeScale double

The engine's RuntimeOptions.MaxTimeScale: it accepts a time scale in [1/max, max], or +∞.

Nonce LiveControlToken

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.

Properties

AchievedScale

The time scale measured over the engine's telemetry window.

public double AchievedScale { get; init; }

Property Value

double

AckSeq

The sequence number of the last command this state answers; 0 when none.

public uint AckSeq { get; init; }

Property Value

uint

Flags

Allowed / controller / terminal.

public LiveControlFlags Flags { get; init; }

Property Value

LiveControlFlags

IsAllowed

The engine accepts control on this connection.

public bool IsAllowed { get; }

Property Value

bool

IsBadToken

This state answers a hello whose proof matched no token.

public bool IsBadToken { get; }

Property Value

bool

IsController

This connection is the authenticated controller.

public bool IsController { get; }

Property Value

bool

IsOff

Control is off by configuration: the opt-in default.

public bool IsOff { get; }

Property Value

bool

IsRefused

The acknowledged command was refused; Reason says why.

public bool IsRefused { get; }

Property Value

bool

IsRemoteHold

The engine is held by this controller's own, still-unchanged hold.

public bool IsRemoteHold { get; }

Property Value

bool

IsTerminal

The run state is terminal.

public bool IsTerminal { get; }

Property Value

bool

LeaseMs

The remote-hold lease, in milliseconds.

public uint LeaseMs { get; init; }

Property Value

uint

MaxTimeScale

The engine's RuntimeOptions.MaxTimeScale: it accepts a time scale in [1/max, max], or +∞.

public double MaxTimeScale { get; init; }

Property Value

double

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

LiveControlToken

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

string

RunState

The engine's run state.

public LiveRunState RunState { get; init; }

Property Value

LiveRunState

Scale

The requested time scale; PositiveInfinity means unpaced.

public double Scale { get; init; }

Property Value

double

StepsPending

Steps still to execute.

public uint StepsPending { get; init; }

Property Value

uint

TickNumber

The engine's current tick number.

public long TickNumber { get; init; }

Property Value

long

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

RunState LiveRunState
Flags LiveControlFlags
TickNumber long
Scale double
AchievedScale double
StepsPending uint
LeaseMs uint
AckSeq uint
Reason string
MaxTimeScale double
Nonce LiveControlToken

Equals(object)

public override bool Equals(object obj)

Parameters

obj object

Returns

bool

Equals(LiveControlState)

public bool Equals(LiveControlState other)

Parameters

other LiveControlState

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

ToString()

public override string ToString()

Returns

string

Operators

operator ==(LiveControlState, LiveControlState)

public static bool operator ==(LiveControlState left, LiveControlState right)

Parameters

left LiveControlState
right LiveControlState

Returns

bool

operator !=(LiveControlState, LiveControlState)

public static bool operator !=(LiveControlState left, LiveControlState right)

Parameters

left LiveControlState
right LiveControlState

Returns

bool