Table of Contents

Class ControlMessage

Namespace
Typhon.Protocol
Assembly
Typhon.Protocol.dll

Reads whole control messages.

public static class ControlMessage
Inheritance
ControlMessage
Inherited Members

Methods

Parse<T>(ReadOnlySpan<byte>, byte, BodyReader<T>)

Reads a whole message: checks its type byte, reads its body, and refuses trailing bytes — a body shorter than its message is malformed, not padded.

public static T Parse<T>(ReadOnlySpan<byte> message, byte type, ControlMessage.BodyReader<T> read)

Parameters

message ReadOnlySpan<byte>

The whole message.

type byte

The expected type byte.

read ControlMessage.BodyReader<T>

The body reader.

Returns

T

The message.

Type Parameters

T

The message type.

Exceptions

WireFormatException

Another type (1002), or a malformed or over-long body (1007).