public enum CloseCode extends Enum<CloseCode>
CloseCode
enumerates the closure codes specified in
RFC 6455. When closing an established connection an endpoint may
indicate a reason for closure. The interpretation of this reason by
an endpoint, and the action an endpoint should take given this reason,
are left undefined by RFC 6455. The specification defines a set of
status codes and specifies which ranges may be used by extensions,
frameworks, and end applications. The status code and any associated
textual message are optional components of a Close frame.Enum Constant and Description |
---|
ABNORMAL_CLOSURE
Indicates an abnormal closure and should not be used.
|
GOING_AWAY
Indicates that the server is going down or the client browsed away.
|
INTERNAL_SERVER_ERROR
Indicates an unexpected error within the server.
|
INVALID_FRAME_DATA
Indicates that a payload was not consistent with the message type.
|
NO_EXTENSION
Indicates that the server did not negotiate an extension properly.
|
NO_STATUS_CODE
Indicates that no status code was present and should not be used.
|
NORMAL_CLOSURE
Indicates the purpose for the connection has been fulfilled.
|
POLICY_VIOLATION
Indicates an endpoint received a message that violates its policy.
|
PROTOCOL_ERROR
Indicates the connection is terminating due to a protocol error.
|
RESERVED
According to RFC 6455 this has been reserved for future use.
|
TLS_HANDSHAKE_FAILURE
Indicates a validation failure for TLS and should not be used.
|
TOO_BIG
Indicates that a payload is too big to be processed.
|
UNSUPPORTED_DATA
Indicates the connection received a data type it cannot accept.
|
Modifier and Type | Field and Description |
---|---|
int |
code
This is the actual integer value representing the code.
|
int |
high
This is the high order byte for the closure code.
|
int |
low
This is the low order byte for the closure code.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
getData()
This is the data that represents the closure code.
|
static CloseCode |
resolveCode(int high,
int low) |
static CloseCode |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static CloseCode[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final CloseCode NORMAL_CLOSURE
public static final CloseCode GOING_AWAY
public static final CloseCode PROTOCOL_ERROR
public static final CloseCode UNSUPPORTED_DATA
public static final CloseCode RESERVED
public static final CloseCode NO_STATUS_CODE
public static final CloseCode ABNORMAL_CLOSURE
public static final CloseCode INVALID_FRAME_DATA
public static final CloseCode POLICY_VIOLATION
public static final CloseCode TOO_BIG
public static final CloseCode NO_EXTENSION
public static final CloseCode INTERNAL_SERVER_ERROR
public static final CloseCode TLS_HANDSHAKE_FAILURE
public final int code
public final int high
public final int low
public static CloseCode[] values()
for (CloseCode c : CloseCode.values()) System.out.println(c);
public static CloseCode valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic byte[] getData()
public static CloseCode resolveCode(int high, int low)
Copyright © 2015. All rights reserved.