Control Type

Read time 2 minutes Package: Nalix.Abstractions
On this page

Namespace: Nalix.Abstractions.Networking.Protocols
Assembly: Nalix.Abstractions

ControlType (byte) identifies the system-level command carried by a Control protocol frame (ProtocolOpCode.SYSTEM_CONTROL = 0x0001).

Source Mapping

  • src/Nalix.Abstractions/Networking/Protocols/ControlType.cs
  • src/Nalix.Codec/ProtocolFrames/Control.cs

Enum Definition

HexNameDescription
0x00NONENo control message specified.
0x01PINGLiveness and round-trip latency probe request.
0x02PONGResponse sent to a PING request.
0x04DISCONNECTGraceful disconnect notification carrying a ProtocolReason.
0x05ERRORNotification of a protocol, rate-limit, permission, or dispatch error.
0x09RESUMEResume an interrupted session.
0x0ASHUTDOWNRequest or announce graceful server shutdown.
0x0BREDIRECTInstruct client to reconnect to another endpoint.
0x0DNOTICEInformational maintenance or operational notice.
0x10TIMEOUTHandler or request timed out on the server.
0x11FAILGeneric operation failure.
0x12TIMESYNCREQUESTClient request for high-resolution server time (TimeSync).
0x13TIMESYNCRESPONSEServer response with high-resolution timestamps.
0x14CIPHER_UPDATERequest to switch the active CipherSuiteType.
0x15CIPHER_UPDATE_ACKAcknowledges a cipher suite switch.
0x16PUBLIC_KEY_REQUESTClient request for the server’s static public key (TOFU).
0x17POW_REQUESTClient request for a Proof-of-Work challenge puzzle.
0x18SESSION_REKEYRequest to rotate the session symmetric key.
0x19SESSION_REKEY_ACKAcknowledges completion of session key rotation.
0xFERESERVED1Reserved for future protocol extension.
0xFFRESERVED2Reserved for future protocol extension.

Usage

Control frames are pooled via PacketBase<Control>.Create() and default to PacketFlags.SYSTEM:

using Nalix.Abstractions.Networking.Packets;
using Nalix.Abstractions.Networking.Protocols;
using Nalix.Codec.ProtocolFrames;

Control ping = Control.Create();
ping.Initialize(ControlType.PING, sequenceId: 42, reason: ProtocolReason.NONE, flags: PacketFlags.SYSTEM);