Apache Mina study notes (7) - Handler

黄舟
Release: 2023-03-04 22:24:01
Original
1314 people have browsed it

IoHandler has the following functions:

sessionCreated
sessionOpened
sessionClosed
sessionIdle
exceptionCaught
messageReceived
messageSent
Copy after login

sessionCreated Event


The Session Created event occurs when a connection is created. For TCP, the result is that the connection is accepted, and for UDP, the UDP packet is accepted. This function can be used to initialize session parameters.

sessionOpened Event

The session opened event occurs when a connection is opened. It is always called after the sessionCreated event. If a thread 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 this function does not work for the UDP protocol.

exceptionCaught 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 notes (7) - Handler, more For more related content, please pay attention to the PHP Chinese website (www.php.cn)!


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template