public static interface RemoteEndpoint.Async extends RemoteEndpoint
RemoteEndpoint.Async, RemoteEndpoint.Basic
Modifier and Type | Method and Description |
---|---|
long |
getSendTimeout()
Obtain the timeout (in milliseconds) for sending a message
asynchronously.
|
java.util.concurrent.Future<java.lang.Void> |
sendBinary(java.nio.ByteBuffer data)
Send the message asynchronously, using the Future to signal to the client
when the message has been sent.
|
void |
sendBinary(java.nio.ByteBuffer data,
SendHandler completion)
Send the message asynchronously, using the SendHandler to signal to the
client when the message has been sent.
|
java.util.concurrent.Future<java.lang.Void> |
sendObject(java.lang.Object obj)
Encodes object as a message and sends it asynchronously, using the
Future to signal to the client when the message has been sent.
|
void |
sendObject(java.lang.Object obj,
SendHandler completion)
Encodes object as a message and sends it asynchronously, using the
SendHandler to signal to the client when the message has been sent.
|
java.util.concurrent.Future<java.lang.Void> |
sendText(java.lang.String text)
Send the message asynchronously, using the Future to signal to the
client when the message has been sent.
|
void |
sendText(java.lang.String text,
SendHandler completion)
Send the message asynchronously, using the SendHandler to signal to the
client when the message has been sent.
|
void |
setSendTimeout(long timeout)
Set the timeout (in milliseconds) for sending a message
asynchronously.
|
flushBatch, getBatchingAllowed, sendPing, sendPong, setBatchingAllowed
long getSendTimeout()
WebSocketContainer.getDefaultAsyncSendTimeout()
.void setSendTimeout(long timeout)
WebSocketContainer.getDefaultAsyncSendTimeout()
.timeout
- The new timeout for sending messages asynchronously
in milliseconds. A non-positive value means an
infinite timeout.void sendText(java.lang.String text, SendHandler completion)
text
- The text message to sendcompletion
- Used to signal to the client when the message has
been sentjava.util.concurrent.Future<java.lang.Void> sendText(java.lang.String text)
text
- The text message to sendjava.util.concurrent.Future<java.lang.Void> sendBinary(java.nio.ByteBuffer data)
data
- The text message to sendjava.lang.IllegalArgumentException
- if data
is null
.void sendBinary(java.nio.ByteBuffer data, SendHandler completion)
data
- The text message to sendcompletion
- Used to signal to the client when the message has
been sentjava.lang.IllegalArgumentException
- if data
or completion
is null
.java.util.concurrent.Future<java.lang.Void> sendObject(java.lang.Object obj)
obj
- The object to be sent.java.lang.IllegalArgumentException
- if obj
is null
.void sendObject(java.lang.Object obj, SendHandler completion)
obj
- The object to be sent.completion
- Used to signal to the client when the message has
been sentjava.lang.IllegalArgumentException
- if obj
or
completion
is null
.Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.