public abstract class RemoteEndpoint extends Object
RemoteEndpoint interface which should be implemented
by container implementations.| Constructor and Description |
|---|
RemoteEndpoint() |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
close(javax.websocket.CloseReason closeReason)
Send a Close message.
|
abstract Future<?> |
sendBinary(ByteBuffer data)
Send binary message.
|
abstract Future<?> |
sendBinary(ByteBuffer partialByte,
boolean isLast)
Send a binary message in pieces, blocking until all of the message has been transmitted.
|
abstract void |
sendBinary(ByteBuffer data,
javax.websocket.SendHandler handler)
Send binary message.
|
abstract Future<?> |
sendPing(ByteBuffer applicationData)
Send a Ping message containing the given application data to the remote endpoint.
|
abstract Future<?> |
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.
|
abstract Future<?> |
sendText(String text)
Send text message.
|
abstract Future<?> |
sendText(String fragment,
boolean isLast)
Send text message in pieces, blocking until all of the message has been transmitted.
|
abstract void |
sendText(String text,
javax.websocket.SendHandler handler)
Send text message.
|
abstract void |
setWriteTimeout(long timeoutMs)
Sets the timeout for the writing operation.
|
public abstract Future<?> sendText(String text)
text - the message to be sent.Future related to send command.public abstract void sendText(String text, javax.websocket.SendHandler handler)
text - the message to be sent.handler - notification handler. SendHandler.onResult(javax.websocket.SendResult) is called when send
operation is completed.public abstract Future<?> sendBinary(ByteBuffer data)
data - the message to be sent.Future related to send command.public abstract void sendBinary(ByteBuffer data, javax.websocket.SendHandler handler)
data - the message to be sent.handler - notification handler. SendHandler.onResult(javax.websocket.SendResult) is called when send
operation is completed.public abstract Future<?> sendText(String fragment, boolean isLast)
fragment - the piece of the message being sent.isLast - Whether the fragment being sent is the last piece of the message.public abstract Future<?> sendBinary(ByteBuffer partialByte, boolean isLast)
partialByte - the piece of the message being sent.isLast - Whether the fragment being sent is the last piece of the message.public abstract Future<?> sendPing(ByteBuffer applicationData) throws IOException
applicationData - the data to be carried in the ping request.IOExceptionpublic abstract Future<?> sendPong(ByteBuffer applicationData) throws IOException
applicationData - the application data to be carried in the pong response.IOExceptionpublic abstract void close(javax.websocket.CloseReason closeReason)
closeReason - close reason.public abstract void setWriteTimeout(long timeoutMs)
timeoutMs - timeout in milliseconds.Copyright © 2013, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.