org.apache.mina.examples.echoserver
Class EchoProtocolHandler
java.lang.Object
org.apache.mina.io.IoHandlerAdapter
org.apache.mina.examples.echoserver.EchoProtocolHandler
- All Implemented Interfaces:
- IoHandler
public class EchoProtocolHandler
- extends IoHandlerAdapter
IoHandler
implementation for echo server.
- Version:
- $Rev: 264677 $, $Date: 2005-08-30 11:44:35 +0900 $,
- Author:
- Trustin Lee (trustin@apache.org)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EchoProtocolHandler
public EchoProtocolHandler()
sessionCreated
public void sessionCreated(IoSession session)
- Description copied from interface:
IoHandler
- Invoked when the session is created. Initialize default socket
parameters and user-defined attributes here.
- Specified by:
sessionCreated
in interface IoHandler
- Overrides:
sessionCreated
in class IoHandlerAdapter
exceptionCaught
public void exceptionCaught(IoSession session,
Throwable cause)
- Description copied from interface:
IoHandler
- Invoked when any exception is thrown by user
IoHandler
implementation or by MINA. If cause
is instanceof
IOException
, MINA will close the connection automatically.
- Specified by:
exceptionCaught
in interface IoHandler
- Overrides:
exceptionCaught
in class IoHandlerAdapter
dataRead
public void dataRead(IoSession session,
ByteBuffer rb)
- Description copied from interface:
IoHandler
- Invoked when data is read from the connection. You can access
buf
to get read data. buf
returns to
the internal buffer pool of MINA after this method is invoked, so
please don't try to reuse it.
- Specified by:
dataRead
in interface IoHandler
- Overrides:
dataRead
in class IoHandlerAdapter
Copyright © 2004-2005 . All Rights Reserved.