Class ControlMessage
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
messageReadOnlySpan<byte>The whole message.
typebyteThe expected type byte.
readControlMessage.BodyReader<T>The body reader.
Returns
- T
The message.
Type Parameters
TThe message type.
Exceptions
- WireFormatException
Another type (1002), or a malformed or over-long body (1007).