public class TimeServerHandler extends IoHandlerAdapter
Constructor and Description |
---|
TimeServerHandler() |
Modifier and Type | Method and Description |
---|---|
void |
exceptionCaught(IoSession session,
Throwable cause)
Trap exceptions.
|
void |
messageReceived(IoSession session,
Object message)
If the message is 'quit', we exit by closing the session.
|
void |
sessionIdle(IoSession session,
IdleStatus status)
On idle, we just write a message on the console
|
inputClosed, messageSent, sessionClosed, sessionCreated, sessionOpened
public TimeServerHandler()
public void exceptionCaught(IoSession session, Throwable cause) throws Exception
exceptionCaught
in interface IoHandler
exceptionCaught
in class IoHandlerAdapter
session
- The session for which we have got an exceptioncause
- The exception that has been caughtException
- If we get an exception while processing the caught exceptionpublic void messageReceived(IoSession session, Object message) throws Exception
messageReceived
in interface IoHandler
messageReceived
in class IoHandlerAdapter
session
- The session that is receiving a messagemessage
- The received messageException
- If we get an exception while processing the received messagepublic void sessionIdle(IoSession session, IdleStatus status) throws Exception
sessionIdle
in interface IoHandler
sessionIdle
in class IoHandlerAdapter
session
- The idling sessionstatus
- The session's statusException
- If we get an exception while processing the idle eventCopyright © 2004–2016 Apache MINA Project. All rights reserved.