public interface MessageHandler<E>
DemuxingIoHandler
forwards
messageReceived or messageSent events to. You have to
register your handler with the type of the message you want to get notified
using DemuxingIoHandler.addReceivedMessageHandler(Class, MessageHandler)
or DemuxingIoHandler.addSentMessageHandler(Class, MessageHandler)
.限定符和类型 | 字段和说明 |
---|---|
static MessageHandler<java.lang.Object> |
NOOP
A
MessageHandler that does nothing. |
限定符和类型 | 方法和说明 |
---|---|
void |
handleMessage(IoSession session,
E message)
Invoked when the specific type of message is received from or sent to
the specified
session . |
static final MessageHandler<java.lang.Object> NOOP
MessageHandler
that does nothing. This is useful when
you want to ignore a message of a specific type silently.void handleMessage(IoSession session, E message) throws java.lang.Exception
session
.session
- the associated IoSession
message
- the message to decode. Its type is set by the implementationjava.lang.Exception
- if there is an error during the message processing