public class WebSocketRemoteEndpoint extends Object implements RemoteEndpoint
| Modifier and Type | Field and Description |
|---|---|
LogicalConnection |
connection |
OutgoingFrames |
outgoing |
| Constructor and Description |
|---|
WebSocketRemoteEndpoint(LogicalConnection connection,
OutgoingFrames outgoing) |
| Modifier and Type | Method and Description |
|---|---|
InetSocketAddress |
getInetSocketAddress() |
void |
sendBytes(ByteBuffer data)
Blocking write of bytes.
|
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.
|
Future<Void> |
sendStringByFuture(String text)
Initiates the asynchronous transmission of a text message.
|
public final LogicalConnection connection
public final OutgoingFrames outgoing
public WebSocketRemoteEndpoint(LogicalConnection connection, OutgoingFrames outgoing)
public InetSocketAddress getInetSocketAddress()
public void sendBytes(ByteBuffer data) throws IOException
sendBytes in interface RemoteEndpointdata - the message to be sentIOExceptionpublic Future<Void> sendBytesByFuture(ByteBuffer data)
RemoteEndpointsendBytesByFuture in interface RemoteEndpointdata - the data being sentpublic void sendPartialBytes(ByteBuffer fragment, boolean isLast) throws IOException
RemoteEndpointsendPartialBytes in interface RemoteEndpointfragment - the piece of the message being sentIOExceptionpublic void sendPartialString(String fragment, boolean isLast) throws IOException
RemoteEndpointsendPartialString in interface RemoteEndpointfragment - the piece of the message being sentIOExceptionpublic void sendPing(ByteBuffer applicationData) throws IOException
RemoteEndpointsendPing in interface RemoteEndpointapplicationData - the data to be carried in the ping requestIOExceptionpublic void sendPong(ByteBuffer applicationData) throws IOException
RemoteEndpointsendPong in interface RemoteEndpointapplicationData - the application data to be carried in the pong response.IOExceptionpublic void sendString(String text) throws IOException
RemoteEndpointNote: this is a blocking call
sendString in interface RemoteEndpointtext - the message to be sentIOExceptionpublic Future<Void> sendStringByFuture(String text)
RemoteEndpointsendStringByFuture in interface RemoteEndpointtext - the text being sentCopyright © 1995-2015 Mort Bay Consulting. All Rights Reserved.