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 |
sessionCreated(IoSession session)
Invoked from an I/O processor thread when a new connection has been created.
|
void |
sessionOpened(IoSession session)
Invoked when a connection has been opened.
|
exceptionCaught, messageSent, sessionIdlepublic SwingChatClientHandler(SwingChatClientHandler.Callback callback)
public void sessionCreated(IoSession session) throws java.lang.Exception
IoHandlersessionCreated 在接口中 IoHandlersessionCreated 在类中 IoHandlerAdapterjava.lang.Exceptionpublic void sessionOpened(IoSession session) throws java.lang.Exception
IoHandlerIoHandler.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 modesl is configured properly.sessionOpened 在接口中 IoHandlersessionOpened 在类中 IoHandlerAdapterjava.lang.Exceptionpublic void messageReceived(IoSession session, java.lang.Object message) throws java.lang.Exception
IoHandlermessageReceived 在接口中 IoHandlermessageReceived 在类中 IoHandlerAdapterjava.lang.Exceptionpublic void sessionClosed(IoSession session) throws java.lang.Exception
IoHandlersessionClosed 在接口中 IoHandlersessionClosed 在类中 IoHandlerAdapterjava.lang.Exception