public class NettyWebSocketClientHandler extends org.jboss.netty.channel.SimpleChannelUpstreamHandler implements WebSocketClient
NettyWebSocketClient
for controlling your client.Constructor and Description |
---|
NettyWebSocketClientHandler(org.jboss.netty.bootstrap.ClientBootstrap bootstrap,
URI url,
WebSocketActionListener listener) |
Modifier and Type | Method and Description |
---|---|
org.jboss.netty.channel.Channel |
channel()
The channel this client has opened.
|
void |
channelClosed(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.ChannelStateEvent event) |
void |
channelConnected(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.ChannelStateEvent event) |
org.jboss.netty.channel.ChannelFuture |
connect()
Connect to host and port.
|
org.jboss.netty.channel.ChannelFuture |
disconnect()
Disconnect from the server
|
void |
exceptionCaught(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.ExceptionEvent e) |
void |
messageReceived(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.MessageEvent event) |
org.jboss.netty.channel.ChannelFuture |
send(org.jboss.netty.handler.codec.http.websocketx.WebSocketFrame frame)
Send data to server
|
public NettyWebSocketClientHandler(org.jboss.netty.bootstrap.ClientBootstrap bootstrap, URI url, WebSocketActionListener listener)
public org.jboss.netty.channel.Channel channel()
WebSocketClient
channel
in interface WebSocketClient
public void channelConnected(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.channel.ChannelStateEvent event) throws Exception
channelConnected
in class org.jboss.netty.channel.SimpleChannelUpstreamHandler
Exception
public void channelClosed(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.channel.ChannelStateEvent event) throws Exception
channelClosed
in class org.jboss.netty.channel.SimpleChannelUpstreamHandler
Exception
public void messageReceived(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.channel.MessageEvent event) throws Exception
messageReceived
in class org.jboss.netty.channel.SimpleChannelUpstreamHandler
Exception
public void exceptionCaught(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.channel.ExceptionEvent e) throws Exception
exceptionCaught
in class org.jboss.netty.channel.SimpleChannelUpstreamHandler
Exception
public org.jboss.netty.channel.ChannelFuture connect()
WebSocketClient
connect
in interface WebSocketClient
public org.jboss.netty.channel.ChannelFuture disconnect()
WebSocketClient
disconnect
in interface WebSocketClient
public org.jboss.netty.channel.ChannelFuture send(org.jboss.netty.handler.codec.http.websocketx.WebSocketFrame frame)
WebSocketClient
send
in interface WebSocketClient
frame
- Data for sendingCopyright © 2012–2014. All rights reserved.