- class aiohttp.WSCloseCode¶
IntEnumfor keeping close message code.
A normal closure, meaning that the purpose for which the connection was established has been fulfilled.
An endpoint is “going away”, such as a server going down or a browser having navigated away from a page.
An endpoint is terminating the connection due to a protocol error.
An endpoint is terminating the connection because it has received a type of data it cannot accept (e.g., an endpoint that understands only text data MAY send this if it receives a binary message).
An endpoint is terminating the connection because it has received data within a message that was not consistent with the type of the message (e.g., non-UTF-8 RFC 3629 data within a text message).
An endpoint is terminating the connection because it has received a message that violates its policy. This is a generic status code that can be returned when there is no other more suitable status code (e.g.,
MESSAGE_TOO_BIG) or if there is a need to hide specific details about the policy.
An endpoint is terminating the connection because it has received a message that is too big for it to process.
An endpoint (client) is terminating the connection because it has expected the server to negotiate one or more extension, but the server did not return them in the response message of the WebSocket handshake. The list of extensions that are needed should appear in the /reason/ part of the Close frame. Note that this status code is not used by the server, because it can fail the WebSocket handshake instead.
A server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request.
The service is restarted. a client may reconnect, and if it chooses to do, should reconnect using a randomized delay of 5-30s.
The service is experiencing overload. A client should only connect to a different IP (when there are multiple for the target) or reconnect to the same IP upon user action.
Used to indicate that a connection was closed abnormally (that is, with no close frame being sent) when a status code is expected.
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.
- class aiohttp.WSMsgType¶
A mark for continuation frame, user will never get the message with this type.
Ping frame (sent by client peer).
Pong frame, answer on ping. Sent by server peer.
- CLOSED FRAME
Actually not frame but a flag indicating that websocket was closed.
Actually not frame but a flag indicating that websocket was received an error.
- class aiohttp.WSMessage¶
Websocket message, returned by
Makes sense only for
WSMsgType.CLOSEmessages, contains optional message description.
- json(*, loads=json.loads)¶
Returns parsed JSON data.
loads – optional JSON decoder function.