Package | Description |
---|---|
java.net.http |
High level HTTP and WebSocket API
|
Modifier and Type | Field and Description |
---|---|
static WebSocket.CloseCode |
WebSocket.CloseCode.CANNOT_ACCEPT
Indicates that an endpoint is terminating the connection because it
has received a type of data it cannot accept (e.g., an endpoint that
understands only text data MAY send this if it receives a binary
message).
|
static WebSocket.CloseCode |
WebSocket.CloseCode.GOING_AWAY
Indicates that an endpoint is "going away", such as a server going
down or a browser having navigated away from a page.
|
static WebSocket.CloseCode |
WebSocket.CloseCode.NORMAL_CLOSURE
Indicates a normal close, meaning that the purpose for which the
connection was established has been fulfilled.
|
static WebSocket.CloseCode |
WebSocket.CloseCode.NOT_CONSISTENT
Indicates that an endpoint is terminating the connection because it
has received data within a message that was not consistent with the
type of the message (e.g., non-UTF-8 [RFC3629] data within a text
message).
|
static WebSocket.CloseCode |
WebSocket.CloseCode.PROTOCOL_ERROR
Indicates that an endpoint is terminating the connection due to a
protocol error.
|
static WebSocket.CloseCode |
WebSocket.CloseCode.TOO_BIG
Indicates that an endpoint is terminating the connection because it
has received a message that is too big for it to process.
|
static WebSocket.CloseCode |
WebSocket.CloseCode.UNEXPECTED_CONDITION
Indicates that an endpoint is terminating the connection because it
encountered an unexpected condition that prevented it from fulfilling
the request.
|
static WebSocket.CloseCode |
WebSocket.CloseCode.VIOLATED_POLICY
Indicates that an endpoint is terminating the connection because it
has received a message that violates its policy.
|
Modifier and Type | Method and Description |
---|---|
static WebSocket.CloseCode |
WebSocket.CloseCode.of(int code)
Returns a
CloseCode from its numerical representation. |
Modifier and Type | Method and Description |
---|---|
CompletableFuture<WebSocket> |
WebSocket.sendClose(WebSocket.CloseCode code,
CharSequence reason)
Sends a Close message with the given close code and the reason.
|
Modifier and Type | Method and Description |
---|---|
default void |
WebSocket.Listener.onClose(WebSocket webSocket,
Optional<WebSocket.CloseCode> code,
String reason)
Receives a Close message.
|
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2016, Oracle and/or its affiliates. All rights reserved.
DRAFT 9-internal+0-2016-08-08-112313.buildd.src