Struct KickMessage
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
Properties
Code
public ushort Code { get; init; }
Property Value
Reason
public string Reason { get; init; }
Property Value
Methods
Deconstruct(out ushort, out string)
public void Deconstruct(out ushort Code, out string Reason)
Parameters
Equals(object)
public override bool Equals(object obj)
Parameters
objobject
Returns
Equals(KickMessage)
public bool Equals(KickMessage other)
Parameters
otherKickMessage
Returns
GetHashCode()
public override int GetHashCode()
Returns
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
messageReadOnlySpan<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
readerWireReaderThe reader, positioned after the type byte.
Returns
- KickMessage
The message.
ToString()
public override string ToString()
Returns
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
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
writerWireWriterThe writer.
Operators
operator ==(KickMessage, KickMessage)
public static bool operator ==(KickMessage left, KickMessage right)
Parameters
leftKickMessagerightKickMessage
Returns
operator !=(KickMessage, KickMessage)
public static bool operator !=(KickMessage left, KickMessage right)
Parameters
leftKickMessagerightKickMessage