public interface WebSocketConnection extends BaseConnection
BaseConnection.State, BaseConnection.SuspendToken
Modifier and Type | Method and Description |
---|---|
WebSocketPolicy |
getPolicy()
Access the (now read-only)
WebSocketPolicy in use for this connection. |
String |
getSubProtocol()
Get the SubProtocol in use for this connection.
|
<C> void |
ping(C context,
Callback<C> callback,
byte[] payload)
Send a single ping messages.
|
<C> void |
write(C context,
Callback<C> callback,
byte[] buf,
int offset,
int len)
Send a a binary message.
|
<C> void |
write(C context,
Callback<C> callback,
ByteBuffer buffer)
Send a a binary message.
|
<C> void |
write(C context,
Callback<C> callback,
String message)
Send a series of text messages.
|
close, close, disconnect, getRemoteAddress, getState, isOpen, isReading, notifyClosing, suspend
WebSocketPolicy getPolicy()
WebSocketPolicy
in use for this connection.String getSubProtocol()
<C> void ping(C context, Callback<C> callback, byte[] payload) throws IOException
NIO style with callbacks, allows for knowledge of successful ping send.
Use @OnWebSocketFrame and monitor Pong frames
IOException
<C> void write(C context, Callback<C> callback, byte[] buf, int offset, int len) throws IOException
NIO style with callbacks, allows for concurrent results of the write operation.
IOException
<C> void write(C context, Callback<C> callback, ByteBuffer buffer) throws IOException
NIO style with callbacks, allows for concurrent results of the write operation.
IOException
<C> void write(C context, Callback<C> callback, String message) throws IOException
NIO style with callbacks, allows for concurrent results of the entire write operation. (Callback is only called once at the end of processing all of the messages)
IOException
Copyright © 1995-2012 Mort Bay Consulting. All Rights Reserved.