[websocket] knowledge points for developing online customer service system meaning of status code returned by websocket

Little Red Riding Hood 2.02022-06-23 18:02:24

Reading a websocket When it comes to resources , Sometimes it's wrong , It will return a status code

The meanings of these status codes are listed below :

0–999 Reserved segment , not used .
1000 CLOSE_NORMAL Normally shut down ; Created for whatever purpose , The link has successfully completed the task .
1001 CLOSE_GOING_AWAY The terminal leaves , Maybe it's because of a server error , It may also be because the browser is jumping away from the page with the connection open .
1002 CLOSE_PROTOCOL_ERROR Disconnected due to protocol error .
1003 CLOSE_UNSUPPORTED Disconnected due to receiving an disallowed data type ( If the terminal receiving only text data receives binary data ).
1004 Retain . Its meaning may be defined in the future .
1005 CLOSE_NO_STATUS Retain . Indicates that the expected status code has not been received .
1006 CLOSE_ABNORMAL Retain . It is used to expect the connection to close abnormally when receiving the status code ( in other words , No close frame sent ).
1007 Unsupported Data Disconnected due to malformed data received ( For example, the text message contains non UTF-8 data ).
1008 Policy Violation Disconnected due to receiving non-conforming data . This is a general status code , Not suitable for use 1003 and 1009 Scenario of status code .
1009 CLOSE_TOO_LARGE Disconnect due to receiving too large data frame .
1010 Missing Extension The client expects the server to negotiate one or more extensions , But the server doesn't handle , So the client is disconnected .
1011 Internal Error The client is prevented from completing the request due to unexpected conditions , Therefore, the server is disconnected .
1012 Service Restart The server was disconnected due to restart . [Ref]
1013 Try Again Later The server was disconnected for temporary reasons , If the server is overloaded, disconnect some clients . [Ref]
1014 from WebSocket Standards are reserved for future use .
1015 TLS Handshake Retain . Indicates that the connection cannot be completed because TLS Shake hands and close ( For example, the server certificate cannot be verified ).
1016–1999 from WebSocket Standards are reserved for future use .
2000–2999 from WebSocket Expand and retain the use of .
3000–3999 Can be used by libraries or frameworks . Should not be used by the application . Can be in IANA register , First come first served basis .
4000–4999 Can be used by applications 

thank
Similar articles