Class CloseCodes
Close codes, with the meanings RFC 6455 gives them, plus the engine's private-use range (W24). A KICK carries one of these; on WebSocket the same
number closes the connection.
public static class CloseCodes
- Inheritance
-
CloseCodes
- Inherited Members
Fields
AuthenticationRejected
The application's admission hook rejected the connection's credentials.
public const ushort AuthenticationRejected = 4003
Field Value
ClientRefusedTheStream
The client refused the stream for a fault it cannot report as a WebSocket code — a browser may not send 1002, 1007 or 1009
(03 § 10). It sends BYE 4004 and closes with Normal.
public const ushort ClientRefusedTheStream = 4004
Field Value
FirstApplicationCode
The first code of the application range, 4100–4999.
public const ushort FirstApplicationCode = 4100
Field Value
GoingAway
The server is going away; reconnect with backoff.
public const ushort GoingAway = 1001
Field Value
HelloTimeout
No HELLO within HelloTimeoutMs.
public const ushort HelloTimeout = 4002
Field Value
InternalError
An internal server error, such as a flush failure after a frame was produced.
public const ushort InternalError = 1011
Field Value
LastApplicationCode
The last code of the application range.
public const ushort LastApplicationCode = 4999
Field Value
MalformedPayload
A payload that is inconsistent with its type: a bad index, length, UTF-8 sequence or an over-cap field.
public const ushort MalformedPayload = 1007
Field Value
MessageTooBig
A message above its size limit, detected before decoding.
public const ushort MessageTooBig = 1009
Field Value
NoAcknowledgement
No PING received within the acknowledgement window.
public const ushort NoAcknowledgement = 4001
Field Value
Normal
Normal closure: BYE, or a clean server shutdown.
public const ushort Normal = 1000
Field Value
ProtocolError
Protocol error: framing, or an unknown or out-of-state message type.
public const ushort ProtocolError = 1002
Field Value
TryAgainLater
Try again later: the server is full, or this session lagged too far behind.
public const ushort TryAgainLater = 1013
Field Value
Methods
IsValidClientCode(ushort)
Whether a client may send code in BYE: 1000, or the private-use range 4000–4999 a browser accepts.
public static bool IsValidClientCode(ushort code)
Parameters
codeushortThe close code.