pub fn class_for_close_code(code: Option<u16>) -> ClassExpand description
The class of a socket the server closed, from the close frame’s code.
| Close code | Class |
|---|---|
| 1002, 1003, 1007, 1008, 1009, 1010, 4000–4999 | VenueRefusal, with the code in decimal |
| everything else, and no code at all | Network |
The VenueRefusal codes say the server objected to what it was sent: a
protocol violation, an unacceptable or oversized message, a policy breach,
or an application’s own reason. Every other code, 1000, 1001, 1006 and
1011–1013 among them, says the connection ended without the request being
at fault.