Iohandler has the following functions:
Sessioncreatedsessionopenedsessionclosedsessionidleexceptioncaughtmessagereceivedmessagesent
Sessioncreated Event
The Session Created event occurs when a connection is created. For TCP, the result is connection acceptance, which is acceptable for UDP, which is UDP packets. This function can be used to initialize the session parameters.
sessionopened Event
The session opened event occurs when a connection is opened. He is always called after the sessioncreated event. If a threading model is configured, then this function is called in that thread instead of the I/O processing thread.
Sessionclosed Event
This event occurs when a session is closed.
Sessionidle Event
This event occurs when a session is idle, but the function does not work with the UDP protocol.
Exceptioncaught Event
When a exception is thrown, the function is called.
Messagereceived Event
When a message arrives, the event occurs.
Messagesent Event
The event occurs when sending, such as when calling Iosession.write ()
The above is the Apache Mina study Note (7)-handler content, more relevant content please pay attention to topic.alibabacloud.com (www.php.cn)!