Table of Contents

Class CloseCodes

Namespace
Typhon.Protocol
Assembly
Typhon.Protocol.dll

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

ushort

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

ushort

FirstApplicationCode

The first code of the application range, 4100–4999.

public const ushort FirstApplicationCode = 4100

Field Value

ushort

GoingAway

The server is going away; reconnect with backoff.

public const ushort GoingAway = 1001

Field Value

ushort

HelloTimeout

No HELLO within HelloTimeoutMs.

public const ushort HelloTimeout = 4002

Field Value

ushort

InternalError

An internal server error, such as a flush failure after a frame was produced.

public const ushort InternalError = 1011

Field Value

ushort

LastApplicationCode

The last code of the application range.

public const ushort LastApplicationCode = 4999

Field Value

ushort

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

ushort

MessageTooBig

A message above its size limit, detected before decoding.

public const ushort MessageTooBig = 1009

Field Value

ushort

NoAcknowledgement

No PING received within the acknowledgement window.

public const ushort NoAcknowledgement = 4001

Field Value

ushort

Normal

Normal closure: BYE, or a clean server shutdown.

public const ushort Normal = 1000

Field Value

ushort

ProtocolError

Protocol error: framing, or an unknown or out-of-state message type.

public const ushort ProtocolError = 1002

Field Value

ushort

TryAgainLater

Try again later: the server is full, or this session lagged too far behind.

public const ushort TryAgainLater = 1013

Field Value

ushort

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

code ushort

The close code.

Returns

bool

true when a browser's WebSocket.close would accept it.