public interface WebSocket extends Closeable
| Modifier and Type | Method and Description |
|---|---|
WebSocket |
addWebSocketListener(WebSocketListener l)
Add a
WebSocketListener |
SocketAddress |
getLocalAddress()
Get local address client initiated request from.
|
SocketAddress |
getRemoteAddress()
Get remote address client initiated request to.
|
io.netty.handler.codec.http.HttpHeaders |
getUpgradeHeaders() |
boolean |
isOpen() |
WebSocket |
removeWebSocketListener(WebSocketListener l)
Remove a
WebSocketListener |
WebSocket |
sendMessage(byte[] message)
Send a byte message.
|
WebSocket |
sendMessage(byte[] message,
WebSocketWriteCompleteListener listener)
Send a byte message.
|
WebSocket |
sendMessage(String message)
Send a text message
|
WebSocket |
sendMessage(String message,
WebSocketWriteCompleteListener listener)
Send a text message
|
WebSocket |
sendPing(byte[] payload)
Send a
ping with an optional payload (limited to 125 bytes or less). |
WebSocket |
sendPing(byte[] payload,
WebSocketWriteCompleteListener listener)
Send a
ping with an optional payload (limited to 125 bytes or less). |
WebSocket |
sendPong(byte[] payload)
Send a
ping with an optional payload (limited to 125 bytes or less). |
WebSocket |
sendPong(byte[] payload,
WebSocketWriteCompleteListener listener)
Send a
ping with an optional payload (limited to 125 bytes or less). |
WebSocket |
stream(byte[] fragment,
boolean last)
Allows streaming of multiple binary fragments.
|
WebSocket |
stream(byte[] fragment,
boolean last,
WebSocketWriteCompleteListener listener)
Allows streaming of multiple binary fragments.
|
WebSocket |
stream(byte[] fragment,
int offset,
int len,
boolean last)
Allows streaming of multiple binary fragments.
|
WebSocket |
stream(byte[] fragment,
int offset,
int len,
boolean last,
WebSocketWriteCompleteListener listener)
Allows streaming of multiple binary fragments.
|
WebSocket |
stream(String fragment,
boolean last)
Allows streaming of multiple text fragments.
|
WebSocket |
stream(String fragment,
boolean last,
WebSocketWriteCompleteListener listener)
Allows streaming of multiple text fragments.
|
io.netty.handler.codec.http.HttpHeaders getUpgradeHeaders()
SocketAddress getRemoteAddress()
null if asynchronous provider is unable to provide the remote addressSocketAddress getLocalAddress()
null if asynchronous provider is unable to provide the local addressWebSocket sendMessage(byte[] message)
message - a byte messageWebSocket sendMessage(byte[] message, WebSocketWriteCompleteListener listener)
message - a byte messagelistener - is notified when a message was successfully processed by the channel or in case of failureWebSocket stream(byte[] fragment, boolean last)
fragment - binary fragment.last - flag indicating whether or not this is the last fragment.WebSocket stream(byte[] fragment, boolean last, WebSocketWriteCompleteListener listener)
fragment - binary fragment.last - flag indicating whether or not this is the last fragment.listener - is notified when a fragment was successfully processed by the channel or in case of failureWebSocket stream(byte[] fragment, int offset, int len, boolean last)
fragment - binary fragment.offset - starting offset.len - length.last - flag indicating whether or not this is the last fragment.WebSocket stream(byte[] fragment, int offset, int len, boolean last, WebSocketWriteCompleteListener listener)
fragment - binary fragment.offset - starting offset.len - length.last - flag indicating whether or not this is the last fragment.listener - is notified when a fragment was successfully processed by the channel or in case of failureWebSocket sendMessage(String message)
message - a text messageWebSocket sendMessage(String message, WebSocketWriteCompleteListener listener)
message - a text messagelistener - is notified when a message was successfully processed by the channel or in case of failureWebSocket stream(String fragment, boolean last)
fragment - text fragment.last - flag indicating whether or not this is the last fragment.WebSocket stream(String fragment, boolean last, WebSocketWriteCompleteListener listener)
fragment - text fragment.last - flag indicating whether or not this is the last fragment.listener - is notified when a fragment was successfully processed by the channel or in case of failureWebSocket sendPing(byte[] payload)
ping with an optional payload (limited to 125 bytes or less).payload - the ping payload.WebSocket sendPing(byte[] payload, WebSocketWriteCompleteListener listener)
ping with an optional payload (limited to 125 bytes or less).payload - the ping payload.listener - is notified when the ping was successfully processed by the channel or in case of failureWebSocket sendPong(byte[] payload)
ping with an optional payload (limited to 125 bytes or less).payload - the pong payload.WebSocket sendPong(byte[] payload, WebSocketWriteCompleteListener listener)
ping with an optional payload (limited to 125 bytes or less).payload - the pong payload.listener - is notified when the pong was successfully processed by the channel or in case of failureWebSocket addWebSocketListener(WebSocketListener l)
WebSocketListenerl - a WebSocketListenerWebSocket removeWebSocketListener(WebSocketListener l)
WebSocketListenerl - a WebSocketListenerboolean isOpen()
true if the WebSocket is open/connected.Copyright © 2017. All Rights Reserved.