Table of Contents

Struct KickMessage

Namespace
Typhon.Protocol
Assembly
Typhon.Protocol.dll

KICK (0x04): the session is closed with Code; the reason is at most 123 UTF-8 bytes (W24).

public readonly struct KickMessage : IEquatable<KickMessage>
Implements
Inherited Members

Constructors

KickMessage(ushort, string)

KICK (0x04): the session is closed with Code; the reason is at most 123 UTF-8 bytes (W24).

public KickMessage(ushort Code, string Reason)

Parameters

Code ushort
Reason string

Properties

Code

public ushort Code { get; init; }

Property Value

ushort

Reason

public string Reason { get; init; }

Property Value

string

Methods

Deconstruct(out ushort, out string)

public void Deconstruct(out ushort Code, out string Reason)

Parameters

Code ushort
Reason string

Equals(object)

public override bool Equals(object obj)

Parameters

obj object

Returns

bool

Equals(KickMessage)

public bool Equals(KickMessage other)

Parameters

other KickMessage

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

Parse(ReadOnlySpan<byte>)

Reads a whole KICK message: its type byte, its body, and nothing after it.

public static KickMessage Parse(ReadOnlySpan<byte> message)

Parameters

message ReadOnlySpan<byte>

The message.

Returns

KickMessage

The message.

Read(ref WireReader)

Reads the message body; the type byte has already been read.

public static KickMessage Read(ref WireReader reader)

Parameters

reader WireReader

The reader, positioned after the type byte.

Returns

KickMessage

The message.

ToString()

public override string ToString()

Returns

string

TruncateUtf8(string, int)

The longest prefix of text whose UTF-8 encoding fits maxBytes, cut between code points.

public static string TruncateUtf8(string text, int maxBytes)

Parameters

text string

The text.

maxBytes int

The cap.

Returns

string

The prefix.

Write(ref WireWriter)

Writes the message, type byte included, truncating the reason at a code-point boundary to fit a WebSocket close frame.

public void Write(ref WireWriter writer)

Parameters

writer WireWriter

The writer.

Operators

operator ==(KickMessage, KickMessage)

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

Parameters

left KickMessage
right KickMessage

Returns

bool

operator !=(KickMessage, KickMessage)

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

Parameters

left KickMessage
right KickMessage

Returns

bool