Package | Description |
---|---|
java.net.http |
High level HTTP and WebSocket API
|
Modifier and Type | Method | Description |
---|---|---|
CompletableFuture<WebSocket> |
WebSocket.Builder.buildAsync() |
Builds a
WebSocket . |
CompletableFuture<WebSocket> |
WebSocket.sendBinary(ByteBuffer message,
boolean isLast) |
Sends a Binary message with bytes from the given
ByteBuffer . |
CompletableFuture<WebSocket> |
WebSocket.sendClose() |
Sends an empty Close message.
|
CompletableFuture<WebSocket> |
WebSocket.sendClose(WebSocket.CloseCode code,
CharSequence reason) |
Sends a Close message with the given close code and the reason.
|
CompletableFuture<WebSocket> |
WebSocket.sendPing(ByteBuffer message) |
Sends a Ping message.
|
CompletableFuture<WebSocket> |
WebSocket.sendPong(ByteBuffer message) |
Sends a Pong message.
|
default CompletableFuture<WebSocket> |
WebSocket.sendText(CharSequence message) |
Sends a whole Text message with characters from the given
CharSequence . |
CompletableFuture<WebSocket> |
WebSocket.sendText(CharSequence message,
boolean isLast) |
Sends a Text message with characters from the given
CharSequence . |
Modifier and Type | Method | Description |
---|---|---|
default CompletionStage<?> |
WebSocket.Listener.onBinary(WebSocket webSocket,
ByteBuffer message,
WebSocket.MessagePart part) |
Receives a Binary message.
|
default void |
WebSocket.Listener.onClose(WebSocket webSocket,
Optional<WebSocket.CloseCode> code,
String reason) |
Receives a Close message.
|
default void |
WebSocket.Listener.onError(WebSocket webSocket,
Throwable error) |
Notifies an I/O or protocol error has occurred on the
WebSocket . |
default void |
WebSocket.Listener.onOpen(WebSocket webSocket) |
Notifies the
Listener that it is connected to the provided
WebSocket . |
default CompletionStage<?> |
WebSocket.Listener.onPing(WebSocket webSocket,
ByteBuffer message) |
Receives a Ping message.
|
default CompletionStage<?> |
WebSocket.Listener.onPong(WebSocket webSocket,
ByteBuffer message) |
Receives a Pong message.
|
default CompletionStage<?> |
WebSocket.Listener.onText(WebSocket webSocket,
CharSequence message,
WebSocket.MessagePart part) |
Receives a Text 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. 500 Oracle Parkway
Redwood Shores, CA 94065 USA. All rights reserved.
DRAFT 9-Debian+0-9b148-1