pub enum CloseCode {
Normal = 1_000,
Away = 1_001,
ProtocolError = 1_002,
Unsupported = 1_003,
NoStatusRcvd = 1_005,
Abnormal = 1_006,
InvalidPayload = 1_007,
PolicyViolation = 1_008,
MessageTooBig = 1_009,
MandatoryExt = 1_010,
InternalError = 1_011,
TLSHandshake = 1_015,
}
Expand description
When closing an established connection an endpoint MAY indicate a reason for closure.
Variants§
Normal = 1_000
The purpose for which the connection was established has been fulfilled
Away = 1_001
Server going down or a browser having navigated away from a page
ProtocolError = 1_002
An endpoint is terminating the connection due to a protocol error.
Unsupported = 1_003
It has received a type of data it cannot accept
NoStatusRcvd = 1_005
MUST NOT be set as a status code in a Close control frame by an endpoint.
No status code was actually present.
Abnormal = 1_006
MUST NOT be set as a status code in a Close control frame by an endpoint.
Connection was closed abnormally.
InvalidPayload = 1_007
Application has received data within a message that was not consistent with the type of the message.
PolicyViolation = 1_008
This is a generic status code that can be returned when there is no other more suitable status code.
MessageTooBig = 1_009
Message that is too big for it to process.
MandatoryExt = 1_010
It has expected the server to negotiate one or more extension.
InternalError = 1_011
The server has encountered an unexpected condition that prevented it from fulfilling the request.
TLSHandshake = 1_015
MUST NOT be set as a status code in a Close control frame by an endpoint.
The connection was closed due to a failure to perform a TLS handshake.