|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface WebSocket
A Websocket client
| Method Summary | |
|---|---|
WebSocket |
addMessageListener(WebSocketListener l)
Add a WebSocketListener |
void |
close()
Close the WebSocket. |
boolean |
isOpen()
Returns true if the WebSocket is open/connected. |
WebSocket |
sendMessage(byte[] message)
Send a byte message. |
WebSocket |
sendPing(byte[] payload)
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 |
sendTextMessage(String message)
Send a text message |
WebSocket |
stream(byte[] fragment,
boolean last)
Allows streaming of multiple binary fragments. |
WebSocket |
stream(byte[] fragment,
int offset,
int len,
boolean last)
Allows streaming of multiple binary fragments. |
WebSocket |
streamText(String fragment,
boolean last)
Allows streaming of multiple text fragments. |
| Method Detail |
|---|
WebSocket sendMessage(byte[] message)
message - a byte message
WebSocket stream(byte[] fragment,
boolean last)
fragment - binary fragment.last - flag indicating whether or not this is the last fragment.
WebSocket 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 sendTextMessage(String message)
message - a text message
WebSocket streamText(String fragment,
boolean last)
fragment - text fragment.last - flag indicating whether or not this is the last fragment.
WebSocket sendPing(byte[] payload)
ping with an optional payload
(limited to 125 bytes or less).
- Parameters:
payload - the ping payload.
- Returns:
- this.
WebSocket sendPong(byte[] payload)
ping with an optional payload
(limited to 125 bytes or less).
- Parameters:
payload - the pong payload.
- Returns:
- this.
WebSocket addMessageListener(WebSocketListener l)
WebSocketListener
l - a WebSocketListener
boolean isOpen()
true if the WebSocket is open/connected.
true if the WebSocket is open/connected.void close()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||