WebSocket

WebSocket 1005 No Status Received vs 1009 Message Too Big

Both WebSocket 1005 (No Status Received) and 1009 (Message Too Big) belong to the WebSocket Close Codes category. 1005 indicates that a reserved value that indicates no status code was present in the Close frame. This code must not be set by an endpoint when sending a Close frame. Meanwhile, 1009 means that an endpoint is terminating the connection because it received a message that is too large for it to process.

Beschreibung

A reserved value that indicates no status code was present in the Close frame. This code must not be set by an endpoint when sending a Close frame.

Wann Sie es sehen

The peer closed the connection with a Close frame that contained no status code payload. Your WebSocket library surfaces 1005 as a sentinel to indicate the absence of a code.

Wie man es behebt

This is an internal indicator, not a wire protocol value. If you see it frequently, the remote peer may have a bug where it sends empty Close frames — check the peer's implementation.

Beschreibung

An endpoint is terminating the connection because it received a message that is too large for it to process.

Wann Sie es sehen

The message payload exceeded the server's configured maximum frame or message size limit. Common when uploading large files or sending huge JSON payloads over WebSocket.

Wie man es behebt

Reduce the message size by chunking large payloads into smaller frames. Alternatively, increase the server's max message size configuration if the large payload is expected.

Wesentliche Unterschiede

1.

WebSocket 1005: A reserved value that indicates no status code was present in the Close frame. This code must not be set by an endpoint when sending a Close frame.

2.

WebSocket 1009: An endpoint is terminating the connection because it received a message that is too large for it to process.

3.

You encounter 1005 when the peer closed the connection with a Close frame that contained no status code payload. Your WebSocket library surfaces 1005 as a sentinel to indicate the absence of a code.

4.

You encounter 1009 when the message payload exceeded the server's configured maximum frame or message size limit. Common when uploading large files or sending huge JSON payloads over WebSocket.

Wann welchen verwenden

For 1005 (No Status Received): This is an internal indicator, not a wire protocol value. If you see it frequently, the remote peer may have a bug where it sends empty Close frames — check the peer's implementation. For 1009 (Message Too Big): Reduce the message size by chunking large payloads into smaller frames. Alternatively, increase the server's max message size configuration if the large payload is expected.

Mehr erfahren