|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ning.http.client.providers.netty.NettyWebSocket
public class NettyWebSocket
| Constructor Summary | |
|---|---|
NettyWebSocket(org.jboss.netty.channel.Channel channel)
|
|
| Method Summary | |
|---|---|
WebSocket |
addMessageListener(WebSocketListener l)
Add a WebSocketListener |
void |
close()
Close the WebSocket. |
boolean |
isOpen()
Returns true if the WebSocket is open/connected. |
protected void |
onClose()
|
protected void |
onError(Throwable t)
|
protected void |
onMessage(byte[] message)
|
protected void |
onTextMessage(String message)
|
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. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public NettyWebSocket(org.jboss.netty.channel.Channel channel)
| Method Detail |
|---|
public WebSocket sendMessage(byte[] message)
WebSocket
sendMessage in interface WebSocketmessage - a byte message
public WebSocket stream(byte[] fragment,
boolean last)
WebSocket
stream in interface WebSocketfragment - binary fragment.last - flag indicating whether or not this is the last fragment.
public WebSocket stream(byte[] fragment,
int offset,
int len,
boolean last)
WebSocket
stream in interface WebSocketfragment - binary fragment.offset - starting offset.len - length.last - flag indicating whether or not this is the last fragment.
public WebSocket sendTextMessage(String message)
WebSocket
sendTextMessage in interface WebSocketmessage - a text message
public WebSocket streamText(String fragment,
boolean last)
WebSocket
streamText in interface WebSocketfragment - text fragment.last - flag indicating whether or not this is the last fragment.
public WebSocket sendPing(byte[] payload)
WebSocketping with an optional payload
(limited to 125 bytes or less).
- Specified by:
sendPing in interface WebSocket
- Parameters:
payload - the ping payload.
- Returns:
- this.
public WebSocket sendPong(byte[] payload)
WebSocketping with an optional payload
(limited to 125 bytes or less).
- Specified by:
sendPong in interface WebSocket
- Parameters:
payload - the pong payload.
- Returns:
- this.
public WebSocket addMessageListener(WebSocketListener l)
WebSocketWebSocketListener
addMessageListener in interface WebSocketl - a WebSocketListener
public boolean isOpen()
WebSockettrue if the WebSocket is open/connected.
isOpen in interface WebSockettrue if the WebSocket is open/connected.public void close()
WebSocket
close in interface WebSocketprotected void onMessage(byte[] message)
protected void onTextMessage(String message)
protected void onError(Throwable t)
protected void onClose()
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||