Apache Mina Study Notes (7)-Handler

Source: Internet
Author: User
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)!

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.