Enum web_socket::CloseCode
source · pub enum CloseCode {
Normal,
Away,
ProtocolError,
Unsupported,
NoStatusRcvd,
Abnormal,
InvalidPayload,
PolicyViolation,
MessageTooBig,
MandatoryExt,
InternalError,
TLSHandshake,
}
Expand description
When closing an established connection an endpoint MAY indicate a reason for closure.
Variants§
Normal
The purpose for which the connection was established has been fulfilled
Away
Server going down or a browser having navigated away from a page
ProtocolError
An endpoint is terminating the connection due to a protocol error.
Unsupported
It has received a type of data it cannot accept
NoStatusRcvd
MUST NOT be set as a status code in a Close control frame by an endpoint.
No status code was actually present.
Abnormal
MUST NOT be set as a status code in a Close control frame by an endpoint.
Connection was closed abnormally.
InvalidPayload
Application has received data within a message that was not consistent with the type of the message.
PolicyViolation
This is a generic status code that can be returned when there is no other more suitable status code.
MessageTooBig
Message that is too big for it to process.
MandatoryExt
It has expected the server to negotiate one or more extension.
InternalError
The server has encountered an unexpected condition that prevented it from fulfilling the request.
TLSHandshake
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.