public interface RemoteEndpoint
| Modifier and Type | Method and Description |
|---|---|
void |
flush()
Flushes messages that may have been batched by the implementation.
|
BatchMode |
getBatchMode() |
InetSocketAddress |
getInetSocketAddress()
Get the InetSocketAddress for the established connection.
|
void |
sendBytes(ByteBuffer data)
Send a binary message, returning when all bytes of the message has been transmitted.
|
void |
sendBytes(ByteBuffer data,
WriteCallback callback)
Initiates the asynchronous transmission of a binary message.
|
Future<Void> |
sendBytesByFuture(ByteBuffer data)
Initiates the asynchronous transmission of a binary message.
|
void |
sendPartialBytes(ByteBuffer fragment,
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 bytes of the message has been transmitted.
|
void |
sendString(String text,
WriteCallback callback)
Initiates the asynchronous transmission of a text message.
|
Future<Void> |
sendStringByFuture(String text)
Initiates the asynchronous transmission of a text message.
|
void |
setBatchMode(BatchMode mode)
Set the batch mode with which messages are sent.
|
void sendBytes(ByteBuffer data) throws IOException
Note: this is a blocking call
data - the message to be sentIOException - if unable to send the bytesFuture<Void> sendBytesByFuture(ByteBuffer data)
data - the data being sentvoid sendBytes(ByteBuffer data, WriteCallback callback)
data - the data being sentcallback - callback to notify of success or failure of the write operationvoid sendPartialBytes(ByteBuffer fragment, boolean isLast) throws IOException
fragment - the piece of the message being sentisLast - true if this is the last piece of the partial bytesIOException - if unable to send the partial bytesvoid sendPartialString(String fragment, boolean isLast) throws IOException
fragment - the piece of the message being sentisLast - true if this is the last piece of the partial bytesIOException - if unable to send the partial bytesvoid sendPing(ByteBuffer applicationData) throws IOException
applicationData - the data to be carried in the ping requestIOException - if unable to send the pingvoid sendPong(ByteBuffer applicationData) throws IOException
applicationData - the application data to be carried in the pong response.IOException - if unable to send the pongvoid sendString(String text) throws IOException
Note: this is a blocking call
text - the message to be sentIOException - if unable to send the text messageFuture<Void> sendStringByFuture(String text)
text - the text being sentvoid sendString(String text, WriteCallback callback)
text - the text being sentcallback - callback to notify of success or failure of the write operationBatchMode getBatchMode()
flush()void setBatchMode(BatchMode mode)
mode - the batch mode to useflush()InetSocketAddress getInetSocketAddress()
void flush()
throws IOException
IOException - if the flush failsgetBatchMode()Copyright © 1995–2017 Webtide. All rights reserved.