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, sessionIdle
public SwingChatClientHandler(SwingChatClientHandler.Callback callback)
public void sessionCreated(IoSession session) throws java.lang.Exception
IoHandler
sessionCreated
在接口中 IoHandler
sessionCreated
在类中 IoHandlerAdapter
java.lang.Exception
public void sessionOpened(IoSession session) throws java.lang.Exception
IoHandler
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 modesl is configured properly.sessionOpened
在接口中 IoHandler
sessionOpened
在类中 IoHandlerAdapter
java.lang.Exception
public void messageReceived(IoSession session, java.lang.Object message) throws java.lang.Exception
IoHandler
messageReceived
在接口中 IoHandler
messageReceived
在类中 IoHandlerAdapter
java.lang.Exception
public void sessionClosed(IoSession session) throws java.lang.Exception
IoHandler
sessionClosed
在接口中 IoHandler
sessionClosed
在类中 IoHandlerAdapter
java.lang.Exception