org.jboss.netty.example.echo
Class EchoClientHandler
java.lang.Object
org.jboss.netty.channel.SimpleChannelUpstreamHandler
org.jboss.netty.example.echo.EchoClientHandler
- All Implemented Interfaces:
- ChannelHandler, ChannelUpstreamHandler
public class EchoClientHandler
- extends SimpleChannelUpstreamHandler
Handler implementation for the echo client. It initiates the ping-pong
traffic between the echo client and server by sending the first message to
the server.
- Version:
- $Rev: 2121 $, $Date: 2010-02-02 09:38:07 +0900 (Tue, 02 Feb 2010) $
- Author:
- The Netty Project, Trustin Lee
Constructor Summary |
EchoClientHandler(int firstMessageSize)
Creates a client-side handler. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EchoClientHandler
public EchoClientHandler(int firstMessageSize)
- Creates a client-side handler.
getTransferredBytes
public long getTransferredBytes()
channelConnected
public void channelConnected(ChannelHandlerContext ctx,
ChannelStateEvent e)
- Description copied from class:
SimpleChannelUpstreamHandler
- Invoked when a
Channel
is open, bound to a local address, and
connected to a remote address.
- Overrides:
channelConnected
in class SimpleChannelUpstreamHandler
messageReceived
public void messageReceived(ChannelHandlerContext ctx,
MessageEvent e)
- Description copied from class:
SimpleChannelUpstreamHandler
- Invoked when a message object (e.g:
ChannelBuffer
) was received
from a remote peer.
- Overrides:
messageReceived
in class SimpleChannelUpstreamHandler
exceptionCaught
public void exceptionCaught(ChannelHandlerContext ctx,
ExceptionEvent e)
- Description copied from class:
SimpleChannelUpstreamHandler
- Invoked when an exception was raised by an I/O thread or a
ChannelHandler
.
- Overrides:
exceptionCaught
in class SimpleChannelUpstreamHandler
Copyright © 2008-2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.