public class GrizzlyRemoteEndpoint extends Object implements RemoteEndpoint
| Constructor and Description |
|---|
GrizzlyRemoteEndpoint(org.glassfish.grizzly.websockets.WebSocket socket) |
| Modifier and Type | Method and Description |
|---|---|
static GrizzlyRemoteEndpoint |
get(org.glassfish.grizzly.websockets.WebSocket socket) |
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.
|
String |
getUri() |
boolean |
isConnected() |
static void |
remove(org.glassfish.grizzly.websockets.WebSocket socket) |
void |
sendBytes(ByteBuffer byteBuffer)
Send a binary message, returning when all of the message has been transmitted.
|
Future<SendResult> |
sendBytes(ByteBuffer byteBuffer,
SendHandler sendHandler)
Initiates the asynchronous transmission of a binary message.
|
void |
sendObject(Object o)
Sends a custom developer object, blocking until it has been transmitted.
|
Future<SendResult> |
sendObject(Object o,
SendHandler handler)
Initiates the transmission of a custom developer object.
|
void |
sendPartialBytes(ByteBuffer byteBuffer,
boolean b)
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 byteBuffer)
Send a Ping message containing the given application data to the remote endpoint.
|
void |
sendPong(ByteBuffer byteBuffer)
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.
|
Future<SendResult> |
sendString(String text,
SendHandler completion)
Initiates the asynchronous transmission of a text message.
|
public GrizzlyRemoteEndpoint(org.glassfish.grizzly.websockets.WebSocket socket)
public static GrizzlyRemoteEndpoint get(org.glassfish.grizzly.websockets.WebSocket socket)
public static void remove(org.glassfish.grizzly.websockets.WebSocket socket)
public boolean isConnected()
public String getUri()
public void sendString(String text) throws IOException
RemoteEndpointsendString in interface RemoteEndpointtext - the message to be sent.IOExceptionpublic void sendBytes(ByteBuffer byteBuffer) throws IOException
RemoteEndpointsendBytes in interface RemoteEndpointbyteBuffer - the message to be sent.IOExceptionpublic void sendPartialString(String fragment, boolean isLast) throws IOException
RemoteEndpointsendPartialString in interface RemoteEndpointfragment - the piece of the message being sent.IOExceptionpublic void sendPartialBytes(ByteBuffer byteBuffer, boolean b) throws IOException
RemoteEndpointsendPartialBytes in interface RemoteEndpointbyteBuffer - the piece of the message being sent.IOExceptionpublic OutputStream getSendStream() throws IOException
RemoteEndpointgetSendStream in interface RemoteEndpointIOExceptionpublic Writer getSendWriter() throws IOException
RemoteEndpointgetSendWriter in interface RemoteEndpointIOExceptionpublic void sendObject(Object o) throws IOException, EncodeException
RemoteEndpointsendObject in interface RemoteEndpointo - the object to be sent.IOExceptionEncodeExceptionpublic Future<SendResult> sendString(String text, SendHandler completion)
RemoteEndpointsendString in interface RemoteEndpointtext - the text being sent.completion - the handler which will be notified of progress.public Future<SendResult> sendBytes(ByteBuffer byteBuffer, SendHandler sendHandler)
RemoteEndpointsendBytes in interface RemoteEndpointbyteBuffer - the data being sent.sendHandler - the handler that will be notified of progress.public Future<SendResult> sendObject(Object o, SendHandler handler)
RemoteEndpointsendObject in interface RemoteEndpointo - the object being sent.public void sendPing(ByteBuffer byteBuffer)
RemoteEndpointsendPing in interface RemoteEndpointbyteBuffer - the data to be carried in the ping request.public void sendPong(ByteBuffer byteBuffer)
RemoteEndpointsendPong in interface RemoteEndpointbyteBuffer - the application data to be carried in the pong response.Copyright © 2012. All Rights Reserved.