public class TimeServerHandler extends IoHandlerAdapter
构造器和说明 |
---|
TimeServerHandler() |
限定符和类型 | 方法和说明 |
---|---|
void |
exceptionCaught(IoSession session,
java.lang.Throwable cause)
Trap exceptions.
|
void |
messageReceived(IoSession session,
java.lang.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 void exceptionCaught(IoSession session, java.lang.Throwable cause) throws java.lang.Exception
exceptionCaught
在接口中 IoHandler
exceptionCaught
在类中 IoHandlerAdapter
session
- The session for which we have got an exceptioncause
- The exception that has been caughtjava.lang.Exception
- If we get an exception while processing the caught exceptionpublic void messageReceived(IoSession session, java.lang.Object message) throws java.lang.Exception
messageReceived
在接口中 IoHandler
messageReceived
在类中 IoHandlerAdapter
session
- The session that is receiving a messagemessage
- The received messagejava.lang.Exception
- If we get an exception while processing the received messagepublic void sessionIdle(IoSession session, IdleStatus status) throws java.lang.Exception
sessionIdle
在接口中 IoHandler
sessionIdle
在类中 IoHandlerAdapter
session
- The idling sessionstatus
- The session's statusjava.lang.Exception
- If we get an exception while processing the idle event