|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ning.http.client.providers.netty.NettyWebSocket
public class NettyWebSocket
Constructor Summary | |
---|---|
NettyWebSocket(org.jboss.netty.channel.Channel channel)
|
Method Summary | |
---|---|
WebSocket |
addWebSocketListener(WebSocketListener l)
Add a WebSocketListener |
void |
close()
Close the WebSocket. |
void |
close(int statusCode,
String reason)
|
int |
getMaxBufferSize()
|
boolean |
isOpen()
Returns true if the WebSocket is open/connected. |
protected void |
onBinaryFragment(byte[] message,
boolean last)
|
protected void |
onClose()
|
protected void |
onClose(int code,
String reason)
|
protected void |
onError(Throwable t)
|
protected void |
onTextFragment(String message,
boolean last)
|
WebSocket |
removeWebSocketListener(WebSocketListener l)
Add a WebSocketListener |
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 |
void |
setMaxBufferSize(int bufferSize)
|
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 WebSocket
message
- a byte message
public WebSocket stream(byte[] fragment, boolean last)
WebSocket
stream
in interface WebSocket
fragment
- 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 WebSocket
fragment
- 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 WebSocket
message
- a text message
public WebSocket streamText(String fragment, boolean last)
WebSocket
streamText
in interface WebSocket
fragment
- text fragment.last
- flag indicating whether or not this is the last fragment.
public WebSocket sendPing(byte[] payload)
WebSocket
ping 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)
WebSocket
ping 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 addWebSocketListener(WebSocketListener l)
WebSocket
WebSocketListener
addWebSocketListener
in interface WebSocket
l
- a WebSocketListener
public WebSocket removeWebSocketListener(WebSocketListener l)
WebSocket
WebSocketListener
removeWebSocketListener
in interface WebSocket
l
- a WebSocketListener
public int getMaxBufferSize()
public void setMaxBufferSize(int bufferSize)
public boolean isOpen()
WebSocket
true
if the WebSocket is open/connected.
isOpen
in interface WebSocket
true
if the WebSocket is open/connected.public void close()
WebSocket
close
in interface WebSocket
close
in interface Closeable
public void close(int statusCode, String reason)
protected void onBinaryFragment(byte[] message, boolean last)
protected void onTextFragment(String message, boolean last)
protected void onError(Throwable t)
protected void onClose()
protected void onClose(int code, String reason)
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |