ApacheMina Study Notes (7)-Handler

Source: Internet
Author: User
When a connection is created, the SessionCreated event occurs. For TCP, the result is connection acceptance, and for UDP, UDP data packets are accepted. This function can be used to initialize the session parameter. IoHandler has the following functions:

SessionCreatedsessionOpenedsessionClosedsessionIdleexceptionCaughtmessageReceivedmessageSent

SessionCreated Event


When a connection is Created, the Session Created event occurs. For TCP, the result is connection acceptance, and for UDP, UDP data packets are accepted. This function can be used to initialize the session parameter.

SessionOpened Event

When a connection is opened, the session opened event occurs. It is always called after the sessionCreated event. If a thread model is configured, this function is called in this thread instead of being called in 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 this function does not work with UDP.

Predictioncaught Event

This function is called when an Exception is thrown.

MessageReceived Event

This event occurs when a message arrives.

MessageSent Event

This event occurs when sending, such as calling IoSession. write ().

The above is the content of Apache Mina study note (7)-Handler. For more information, see PHP Chinese website (www.php1.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.