Skip to main content

class_for_close_code

Function class_for_close_code 

Source
pub fn class_for_close_code(code: Option<u16>) -> Class
Expand description

The class of a socket the server closed, from the close frame’s code.

Close codeClass
1002, 1003, 1007, 1008, 1009, 1010, 4000–4999VenueRefusal, with the code in decimal
everything else, and no code at allNetwork

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.