WebSocketStatusCodes enum Client Entity

Endpoints MAY use the following pre-defined status codes when sending a Close frame. Web API RFC 6455, Section 7.4.1

0..999 - Unused Status codes in the range 0-999 are not used.

1016..2999 - Reserved for websocket extensions Status codes in the range 1000-2999 are reserved for definition by this protocol, its future revisions, and extensions specified in a permanent and readily available public specification.

3000..3999 - Registered first come first serve at IANA Status codes in the range 3000-3999 are reserved for use by libraries, frameworks, and applications. These status codes are registered directly with IANA. The interpretation of these codes is undefined by this protocol.

4000..4999 - Available for applications Status codes in the range 4000-4999 are reserved for private use and thus can't be registered. Such codes can be used by prior agreements between WebSocket applications. The interpretation of these codes is undefined by this protocol.

Inheritance
Implemented types

Constructors

WebSocketStatusCodes(int code, String codename)
WebSocket status codes.
const

Values

normalClosure → const WebSocketStatusCodes

Successful operation / regular socket shutdown. The connection successfully completed the purpose for which it was created.

const WebSocketStatusCodes(1000, 'NORMAL_CLOSURE')
goingAway → const WebSocketStatusCodes

Client is leaving. The endpoint is going away, either because of a server failure or because the browser is navigating away from the page that opened the connection. For example, a browser tab closing.

const WebSocketStatusCodes(1001, 'GOING_AWAY')
protocolError → const WebSocketStatusCodes

The endpoint is terminating the connection due to a protocol error.

const WebSocketStatusCodes(1002, 'PROTOCOL_ERROR')
unsupportedData → const WebSocketStatusCodes

The connection is being terminated because the endpoint received data of a type it cannot accept. For example, a text-only endpoint received binary data.

const WebSocketStatusCodes(1003, 'UNSUPPORTED_DATA')
reserved → const WebSocketStatusCodes

Reserved. A meaning might be defined in the future.

const WebSocketStatusCodes(1004, 'RESERVED')
noStatusReceived → const WebSocketStatusCodes

Reserved. Indicates that no status code was provided even though one was expected.

const WebSocketStatusCodes(1005, 'NO_STATUS_RECEIVED')
abnormalClosure → const WebSocketStatusCodes

Reserved. Indicates that a connection was closed abnormally when a status code is expected.

const WebSocketStatusCodes(1006, 'ABNORMAL_CLOSURE')
invalidFramePayloadData → const WebSocketStatusCodes

The endpoint is terminating the connection because a message was received that contained inconsistent data. For example, non-UTF-8 data within a text message.

const WebSocketStatusCodes(1007, 'UNSUPPORTED_PAYLOAD')
policyViolation → const WebSocketStatusCodes

The endpoint is terminating the connection because it received a message that violates its policy. This is a generic status code, used when codes 1003 and 1009 are not suitable.

const WebSocketStatusCodes(1008, 'POLICY_VIOLATION')
messageTooBig → const WebSocketStatusCodes

The endpoint is terminating the connection because a data frame was received that is too large.

const WebSocketStatusCodes(1009, 'TOO_LARGE')
mandatoryExtension → const WebSocketStatusCodes

The client is terminating the connection because it expected the server to negotiate one or more extension, but the server didn't.

const WebSocketStatusCodes(1010, 'MANDATORY_EXTENSION')
internalError → const WebSocketStatusCodes

The server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request.

const WebSocketStatusCodes(1011, 'INTERNAL_ERROR')
serviceRestart → const WebSocketStatusCodes

The server is terminating the connection because it is restarting.

const WebSocketStatusCodes(1012, 'RESTART')
tryAgainLater → const WebSocketStatusCodes

The server is terminating the connection due to a temporary condition. For example, it is overloaded and is casting off some of its clients.

const WebSocketStatusCodes(1013, 'TRY_AGAIN_LATER')
badGateway → const WebSocketStatusCodes

The server was acting as a gateway or proxy and received an invalid response from the upstream server. This is similar to 502 HTTP Status Code.

const WebSocketStatusCodes(1014, 'BAD_GATEWAY')
tlsHandshake → const WebSocketStatusCodes

Reserved. Indicates that the connection was closed due to a failure to perform a TLS handshake. For example, the server certificate can't be verified.

const WebSocketStatusCodes(1015, 'TLS_HANDSHAKE')

Properties

code int
Close code (uint16).
final
codename String
Meaning / Codename
final
hashCode int
The hash code for this object.
no setterinherited
index int
A numeric identifier for the enumerated value.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

compareTo(WebSocketStatusCodes other) int
Compares this object to another object.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

valueOf(int code) WebSocketStatusCodes?
Returns the WebSocketStatusCodes by the given code.

Constants

values → const List<WebSocketStatusCodes>
A constant List of the values in this enum, in order of their declaration.