Table of Contents

Struct SessionEvent

Namespace
Typhon.Engine
Assembly
Typhon.Engine.dll

One thing that happened to one session, as an application system reads it in the tick.

public readonly struct SessionEvent
Inherited Members

Remarks

A single struct rather than one type per kind: the batch is a flat span an application walks with a switch, which keeps the read allocation-free and keeps the ordering between an Opened and a Closed visible — a session that opens and closes inside one tick produces both, in that order, and an application that only handles one of them would otherwise leak whatever it built.

Properties

AppData

Whatever the admission hook attached to this session.

public object AppData { get; }

Property Value

object

CloseCode

The close code the client was given.

public ushort CloseCode { get; }

Property Value

ushort

HelloPayload

The client's HELLO payload, copied out of the transport's buffer. Empty when it sent none.

public ReadOnlyMemory<byte> HelloPayload { get; }

Property Value

ReadOnlyMemory<byte>

Kind

What happened.

public SessionEventKind Kind { get; }

Property Value

SessionEventKind

Limits

The limits admission asked for — the object the hook handed back, not the resolved numbers.

public SessionLimits Limits { get; }

Property Value

SessionLimits

Principal

The authenticated principal, or null — always null until the security work lands.

public ClaimsPrincipal Principal { get; }

Property Value

ClaimsPrincipal

Reason

Why it ended. Meaningful on Closed.

public SessionCloseReason Reason { get; }

Property Value

SessionCloseReason

Resumable

Whether the client may come back to this session within the grace period.

public bool Resumable { get; }

Property Value

bool

ResumedFrom

The session this one resumed, or None. Filled when resume is built.

public SessionId ResumedFrom { get; }

Property Value

SessionId

Role

The role admission gave it. Meaningful on Opened.

public SessionRole Role { get; }

Property Value

SessionRole

Session

Which session it happened to.

public SessionId Session { get; }

Property Value

SessionId

SessionKind

The application-declared kind the client presented.

public string SessionKind { get; }

Property Value

string

Methods

ToString()

public override string ToString()

Returns

string