public static interface RemoteEndpoint.Async extends RemoteEndpoint
RemoteEndpoint.Async, RemoteEndpoint.Basic
Modifier and Type | Method and Description |
---|---|
long |
getSendTimeout()
Return the number of milliseconds the implementation will timeout
attempting to send a websocket message.
|
Future<Void> |
sendBinary(ByteBuffer data)
Initiates the asynchronous transmission of a binary message.
|
void |
sendBinary(ByteBuffer data,
SendHandler handler)
Initiates the asynchronous transmission of a binary message.
|
Future<Void> |
sendObject(Object data)
Initiates the asynchronous transmission of a custom developer object.
|
void |
sendObject(Object data,
SendHandler handler)
Initiates the asynchronous transmission of a custom developer object.
|
Future<Void> |
sendText(String text)
Initiates the asynchronous transmission of a text message.
|
void |
sendText(String text,
SendHandler handler)
Initiates the asynchronous transmission of a text message.
|
void |
setSendTimeout(long timeoutmillis)
Sets the number of milliseconds the implementation will timeout
attempting to send a websocket message.
|
flushBatch, getBatchingAllowed, sendPing, sendPong, setBatchingAllowed
long getSendTimeout()
void setSendTimeout(long timeoutmillis)
timeoutmillis
- The number of milliseconds this RemoteEndpoint will wait before timing out
an incomplete asynchronous message send.void sendText(String text, SendHandler handler)
text
- the text being sent.handler
- the handler which will be notified of progress.IllegalArgumentException
- if the text or the handler is null
.Future<Void> sendText(String text)
null
upon successful completion. Errors
in transmission are wrapped in the ExecutionException
thrown when querying the Future object.text
- the text being sent.IllegalArgumentException
- if the text is null
.Future<Void> sendBinary(ByteBuffer data)
null
upon successful completion. Errors
in transmission are wrapped in the ExecutionException
thrown when querying the Future object.data
- the data being sent.IllegalArgumentException
- if the data is null
.void sendBinary(ByteBuffer data, SendHandler handler)
data
- the data being sent, must not be null
.handler
- the handler that will be notified of progress, must not be null
.IllegalArgumentException
- if either the data or the handler are null
.Future<Void> sendObject(Object data)
null
upon successful completion. Errors
in transmission are wrapped in the ExecutionException
thrown when querying the Future object.data
- the object being sent.IllegalArgumentException
- if the data is null
.void sendObject(Object data, SendHandler handler)
data
- the object being sent.handler
- the handler that will be notified of progress, must not be null
.IllegalArgumentException
- if either the data or the handler are null
.Copyright © 1996-2017, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.