close code
A number a WebSocket endpoint sends when closing a connection, telling the other side why, such as 1000 for normal closure.
In more detail
It should guide the client’s next step: reconnect, refresh its credentials or stop. Codes 1000 to 1015 are defined by the standard, and applications can use the 4000 to 4999 range for their own meanings.
Related terms
- WebSocket — A protocol that turns an HTTP connection into a long-lived, two-way channel where client and server can each send messages at any time.
- reconnection — Re-establishing a dropped long-lived connection and, where supported, resuming from the last message received.
Taught in
- WebSockets — Modern API Architecture: REST, GraphQL & gRPC