|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public static interface RemoteEndpoint.Async
This representation of the peer of a web socket conversation has the ability to send messages asynchronously. The point of completion of the send is defined when all the supplied data has been written to the underlying connection. The completion handlers for the asynchronous methods are always called with a different thread from that which initiated the send.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface javax.websocket.RemoteEndpoint |
---|
RemoteEndpoint.Async, RemoteEndpoint.Basic |
Method Summary | |
---|---|
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. |
Methods inherited from interface javax.websocket.RemoteEndpoint |
---|
flushBatch, getBatchingAllowed, sendPing, sendPong, setBatchingAllowed |
Method Detail |
---|
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
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |