public class SwingChatClientHandler extends IoHandlerAdapter
IoHandler
implementation of the client side of the simple chat protocol.限定符和类型 | 类和说明 |
---|---|
static interface |
SwingChatClientHandler.Callback |
构造器和说明 |
---|
SwingChatClientHandler(SwingChatClientHandler.Callback callback) |
限定符和类型 | 方法和说明 |
---|---|
void |
messageReceived(IoSession session,
java.lang.Object message)
Invoked when a message is received.
|
void |
sessionClosed(IoSession session)
Invoked when a connection is closed.
|
void |
sessionOpened(IoSession session)
Invoked when a connection has been opened.
|
exceptionCaught, inputClosed, messageSent, sessionCreated, sessionIdle
public SwingChatClientHandler(SwingChatClientHandler.Callback callback)
public void sessionOpened(IoSession session) throws java.lang.Exception
IoHandlerAdapter
IoHandler.sessionCreated(IoSession)
. The biggest difference from
IoHandler.sessionCreated(IoSession)
is that it's invoked from other thread
than an I/O processor thread once thread model is configured properly.sessionOpened
在接口中 IoHandler
sessionOpened
在类中 IoHandlerAdapter
session
- The session being openedjava.lang.Exception
- If we get an exception while processing the open eventpublic void messageReceived(IoSession session, java.lang.Object message) throws java.lang.Exception
IoHandlerAdapter
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 sessionClosed(IoSession session) throws java.lang.Exception
IoHandlerAdapter
sessionClosed
在接口中 IoHandler
sessionClosed
在类中 IoHandlerAdapter
session
- The session being closedjava.lang.Exception
- If we get an exception while processing the close event