Lines 29-32
Link Here
|
29 |
public static final byte OPCODE_CLOSE = 0x08; |
29 |
public static final byte OPCODE_CLOSE = 0x08; |
30 |
public static final byte OPCODE_PING = 0x09; |
30 |
public static final byte OPCODE_PING = 0x09; |
31 |
public static final byte OPCODE_PONG = 0x0A; |
31 |
public static final byte OPCODE_PONG = 0x0A; |
|
|
32 |
|
33 |
// Status Codes |
34 |
|
35 |
/* |
36 |
* 1000 indicates a normal closure, meaning whatever purpose the |
37 |
* connection was established for has been fulfilled. |
38 |
*/ |
39 |
public static final int STATUS_CLOSE_NORMAL = 1000; |
40 |
|
41 |
/* |
42 |
* 1001 indicates that an endpoint is "going away", such as a server |
43 |
* going down, or a browser having navigated away from a page. |
44 |
*/ |
45 |
public static final int STATUS_SHUTDOWN = 1001; |
46 |
|
47 |
/* |
48 |
* 1002 indicates that an endpoint is terminating the connection due |
49 |
* to a protocol error. |
50 |
*/ |
51 |
public static final int STATUS_PROTOCOL_ERROR = 1002; |
52 |
|
53 |
/* |
54 |
* 1003 indicates that an endpoint is terminating the connection |
55 |
* because it has received a type of data it cannot accept (e.g. an |
56 |
* endpoint that understands only text data MAY send this if it |
57 |
* receives a binary message). |
58 |
*/ |
59 |
public static final int STATUS_UNEXPECTED_DATA_TYPE = 1003; |
60 |
|
61 |
// 1004 is reserved. The specific meaning might be defined in the future. |
62 |
|
63 |
/* |
64 |
* 1005 is a reserved value and MUST NOT be set as a status code in a |
65 |
* Close control frame by an endpoint. It is designated for use in |
66 |
* applications expecting a status code to indicate that no status |
67 |
* code was actually present. |
68 |
*/ |
69 |
public static final int STATUS_CODE_MISSING = 1005; |
70 |
|
71 |
/* |
72 |
* 1006 is a reserved value and MUST NOT be set as a status code in a |
73 |
* Close control frame by an endpoint. It is designated for use in |
74 |
* applications expecting a status code to indicate that the |
75 |
* connection was closed abnormally, e.g. without sending or |
76 |
* receiving a Close control frame. |
77 |
*/ |
78 |
public static final int STATUS_CLOSED_UNEXPECTEDLY = 1006; |
79 |
|
80 |
/* |
81 |
* 1007 indicates that an endpoint is terminating the connection |
82 |
* because it has received data within a message that was not |
83 |
* consistent with the type of the message (e.g., non-UTF-8 [RFC3629] |
84 |
* data within a text message). |
85 |
*/ |
86 |
public static final int STATUS_BAD_DATA = 1007; |
87 |
|
88 |
/* |
89 |
* 1008 indicates that an endpoint is terminating the connection |
90 |
* because it has received a message that violates its policy. This |
91 |
* is a generic status code that can be returned when there is no |
92 |
* other more suitable status code (e.g. 1003 or 1009), or if there |
93 |
* is a need to hide specific details about the policy. |
94 |
*/ |
95 |
public static final int STATUS_POLICY_VIOLATION = 1008; |
96 |
|
97 |
/* |
98 |
* 1009 indicates that an endpoint is terminating the connection |
99 |
* because it has received a message which is too big for it to |
100 |
* process. |
101 |
*/ |
102 |
public static final int STATUS_MESSAGE_TOO_LARGE = 1009; |
103 |
|
104 |
/* |
105 |
* 1010 indicates that an endpoint (client) is terminating the |
106 |
* connection because it has expected the server to negotiate one or |
107 |
* more extension, but the server didn't return them in the response |
108 |
* message of the WebSocket handshake. The list of extensions which |
109 |
* are needed SHOULD appear in the /reason/ part of the Close frame. |
110 |
* Note that this status code is not used by the server, because it |
111 |
* can fail the WebSocket handshake instead. |
112 |
*/ |
113 |
public static final int STATUS_REQUIRED_EXTENSION = 1010; |
114 |
|
32 |
} |
115 |
} |