Package org.eclipse.jetty.websocket.api
Class CloseStatus
java.lang.Object
org.eclipse.jetty.websocket.api.CloseStatus
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
private static final int
static final int
private String
-
Constructor Summary
ConstructorsConstructorDescriptionCloseStatus
(int closeCode, String reasonPhrase) Creates a reason for closing a web socket connection with the given code and reason phrase. -
Method Summary
-
Field Details
-
MAX_CONTROL_PAYLOAD
private static final int MAX_CONTROL_PAYLOAD- See Also:
-
MAX_REASON_PHRASE
public static final int MAX_REASON_PHRASE- See Also:
-
code
private int code -
phrase
-
-
Constructor Details
-
CloseStatus
Creates a reason for closing a web socket connection with the given code and reason phrase.- Parameters:
closeCode
- the close codereasonPhrase
- the reason phrase- See Also:
-
-
Method Details
-
trimMaxReasonLength
Deprecated.use of this method is strongly discouraged, as it creates too many new objects that are just thrown away to accomplish its goals.Convenience method for trimming a long reason phrase at the maximum reason phrase length of 123 UTF-8 bytes (per WebSocket spec).- Parameters:
reason
- the proposed reason phrase- Returns:
- the reason phrase (trimmed if needed)
-
getCode
public int getCode() -
getPhrase
-