public interface RemoteEndpoint
| Modifier and Type | Method | Description |
|---|---|---|
void |
flush() |
Flushes messages that may have been batched by the implementation.
|
BatchMode |
getBatchMode() |
|
java.net.InetSocketAddress |
getInetSocketAddress() |
Get the InetSocketAddress for the established connection.
|
void |
sendBytes(java.nio.ByteBuffer data) |
Send a binary message, returning when all bytes of the message has been transmitted.
|
void |
sendBytes(java.nio.ByteBuffer data,
WriteCallback callback) |
Initiates the asynchronous transmission of a binary message.
|
java.util.concurrent.Future<java.lang.Void> |
sendBytesByFuture(java.nio.ByteBuffer data) |
Initiates the asynchronous transmission of a binary message.
|
void |
sendPartialBytes(java.nio.ByteBuffer fragment,
boolean isLast) |
Send a binary message in pieces, blocking until all of the message has been transmitted.
|
void |
sendPartialString(java.lang.String fragment,
boolean isLast) |
Send a text message in pieces, blocking until all of the message has been transmitted.
|
void |
sendPing(java.nio.ByteBuffer applicationData) |
Send a Ping message containing the given application data to the remote endpoint.
|
void |
sendPong(java.nio.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(java.lang.String text) |
Send a text message, blocking until all bytes of the message has been transmitted.
|
void |
sendString(java.lang.String text,
WriteCallback callback) |
Initiates the asynchronous transmission of a text message.
|
java.util.concurrent.Future<java.lang.Void> |
sendStringByFuture(java.lang.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(java.nio.ByteBuffer data)
throws java.io.IOException
Note: this is a blocking call
data - the message to be sentjava.io.IOException - if unable to send the bytesjava.util.concurrent.Future<java.lang.Void> sendBytesByFuture(java.nio.ByteBuffer data)
data - the data being sentvoid sendBytes(java.nio.ByteBuffer data,
WriteCallback callback)
data - the data being sentcallback - callback to notify of success or failure of the write operationvoid sendPartialBytes(java.nio.ByteBuffer fragment,
boolean isLast)
throws java.io.IOException
fragment - the piece of the message being sentisLast - true if this is the last piece of the partial bytesjava.io.IOException - if unable to send the partial bytesvoid sendPartialString(java.lang.String fragment,
boolean isLast)
throws java.io.IOException
fragment - the piece of the message being sentisLast - true if this is the last piece of the partial bytesjava.io.IOException - if unable to send the partial bytesvoid sendPing(java.nio.ByteBuffer applicationData)
throws java.io.IOException
applicationData - the data to be carried in the ping requestjava.io.IOException - if unable to send the pingvoid sendPong(java.nio.ByteBuffer applicationData)
throws java.io.IOException
applicationData - the application data to be carried in the pong response.java.io.IOException - if unable to send the pongvoid sendString(java.lang.String text)
throws java.io.IOException
Note: this is a blocking call
text - the message to be sentjava.io.IOException - if unable to send the text messagejava.util.concurrent.Future<java.lang.Void> sendStringByFuture(java.lang.String text)
text - the text being sentvoid sendString(java.lang.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()java.net.InetSocketAddress getInetSocketAddress()
void flush()
throws java.io.IOException
java.io.IOException - if the flush failsgetBatchMode()Copyright © 1995–2018 Webtide. All rights reserved.