public interface RemoteEndpoint
Modifier and Type | Method and Description |
---|---|
OutputStream |
getSendStream()
Opens an output stream on which a binary message may be sent.
|
Writer |
getSendWriter()
Opens an character stream on which a text message may be sent.
|
void |
sendBytes(ByteBuffer data)
Send a binary message, returning when all of the message has been transmitted.
|
void |
sendBytesByCompletion(ByteBuffer data,
SendHandler completion)
Initiates the asynchronous transmission of a binary message.
|
Future<SendResult> |
sendBytesByFuture(ByteBuffer data)
Initiates the asynchronous transmission of a binary message.
|
void |
sendObject(Object o)
Sends a custom developer object, blocking until it has been transmitted.
|
void |
sendObjectByCompletion(Object o,
SendHandler handler)
Initiates the asynchronous transmission of a custom developer object.
|
Future<SendResult> |
sendObjectByFuture(Object o)
Initiates the asynchronous transmission of a custom developer object.
|
void |
sendPartialBytes(ByteBuffer partialByte,
boolean isLast)
Send a binary message in pieces, blocking until all of the message has been transmitted.
|
void |
sendPartialString(String fragment,
boolean isLast)
Send a text message in pieces, blocking until all of the message has been transmitted.
|
void |
sendPing(ByteBuffer applicationData)
Send a Ping message containing the given application data to the remote endpoint.
|
void |
sendPong(ByteBuffer applicationData)
Allows the developer to send an unsolicited Pong message containing the given application
data in order to serve as a unidirectional
heartbeat for the session.
|
void |
sendString(String text)
Send a text message, blocking until all of the message has been transmitted.
|
void |
sendStringByCompletion(String text,
SendHandler completion)
Initiates the asynchronous transmission of a text message.
|
Future<SendResult> |
sendStringByFuture(String text)
Initiates the asynchronous transmission of a text message.
|
void sendString(String text) throws IOException
text
- the message to be sent.IOException
void sendBytes(ByteBuffer data) throws IOException
data
- the message to be sent.IOException
void sendPartialString(String fragment, boolean isLast) throws IOException
fragment
- the piece of the message being sent.isLast
- Whether the fragment being sent is the last piece of the message.IOException
void sendPartialBytes(ByteBuffer partialByte, boolean isLast) throws IOException
partialByte
- the piece of the message being sent.isLast
- Whether the fragment being sent is the last piece of the message.IOException
OutputStream getSendStream() throws IOException
IOException
Writer getSendWriter() throws IOException
IOException
void sendObject(Object o) throws IOException, EncodeException
o
- the object to be sent.IOException
EncodeException
void sendStringByCompletion(String text, SendHandler completion)
text
- the text being sent.completion
- the handler which will be notified of progress.Future<SendResult> sendStringByFuture(String text)
text
- the text being sent.Future<SendResult> sendBytesByFuture(ByteBuffer data)
data
- the data being sent.void sendBytesByCompletion(ByteBuffer data, SendHandler completion)
data
- the data being sent.completion
- the handler that will be notified of progress.Future<SendResult> sendObjectByFuture(Object o)
o
- the object being sent.void sendObjectByCompletion(Object o, SendHandler handler)
o
- the object being sent.handler
- the handler that will be notified of progressvoid sendPing(ByteBuffer applicationData)
applicationData
- the data to be carried in the ping request.void sendPong(ByteBuffer applicationData)
applicationData
- the application data to be carried in the pong response.Copyright © 2013. All Rights Reserved.