public interface SessionListener
EventDispatcher. Implement the protocol workflow by implementing
this interface.
There are 6 session events available:
connectionEstablished: Connected to
the SocketAddressat Sessionsuccessfully.connectionClosed: The connection is
closed. This event always takes place after IOException
(except ConnectException) is thrown because the connection
is automatically closed.messageReceived: The message is read
from the incoming channel data.messageSent: The message is sent to
the socket channel.sessionIdle: The session is idle for
Session.idleTime secondsexceptionCaught: An exception has been
thrown while doing I/O or processing business logic in
SessionListener.| Modifier and Type | Method and Description |
|---|---|
void |
connectionClosed(Session session)
Invoked when the connection is closed.
|
void |
connectionEstablished(Session session)
Invoked when the connection is established.
|
void |
exceptionCaught(Session session,
java.lang.Throwable cause)
Invoked when an exception is caught while communicating.
|
void |
messageReceived(Session session,
Message message)
Invoked when a message has arrived.
|
void |
messageSent(Session session,
Message message)
Invoked when a message has been sent.
|
void |
sessionIdle(Session session)
Invoked when the session is idle for predefined amount of time.
|
void connectionEstablished(Session session)
void connectionClosed(Session session)
void messageReceived(Session session, Message message)
void messageSent(Session session, Message message)
void sessionIdle(Session session)
void exceptionCaught(Session session, java.lang.Throwable cause)
Copyright © 2004-2012 Trustin Lee. All Rights Reserved.