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.
It is not safe for other threads to use the ByteBuffer until the sending of this message is complete. If the sending of the message completes successfully, the buffer's limit will be unchanged and the buffer's position will be equal to the limit. If the sending of the message does not complete successfully, the state of the buffer is undefined.
data
- the data being sent.IllegalArgumentException
- if the data is null
.void sendBinary(ByteBuffer data, SendHandler handler)
It is not safe for other threads to use the ByteBuffer until the sending of this message is complete. If the sending of the message completes successfully, the buffer's limit will be unchanged and the buffer's position will be equal to the limit. If the sending of the message does not complete successfully, the state of the buffer is undefined.
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 © 2018,2020 Eclipse Foundation.
Use is subject to license terms.