The concept and working principle of Android Netty-based message push scheme (II.)

Source: Internet
Author: User

in the previous article I talked about the message push scenario and a simple Hello world based on the Netty implementation, to get a better understanding of the code in Hello World, today I'll explain some of the concepts and how it works in Netty. If you think this article is a bit boring, please read the "Android Netty-based message push solution HelloWorld"

channeleventNetty is event-driven, which is what we have mentioned above, informing "relevant departments" of what happened. Therefore, it is not difficult to understand that in our own business code, there must be some processing related to these events. In the sample code, we deal with the event that is channelconnected. Later, we will also deal with more events.


Channelpipelinepipelines, transmission pathways. It controls the distribution and delivery of channelevent events. The event flows through the pipeline, which is handled with this channelpipeline. For example: development events. First give a design, then to b development. A flow chart, hoping to give you a more intuitive feeling.


pipe Flow diagram :



Channelhandler just said pipeline responsible for the event distribution to the corresponding site, the site in Netty refers to Channelhandler. The incident to the Channelhandler here, is to be specifically processed, our sample code, the implementation is such a processing event "site", that is, your own business logic is generally starting from here.
ChannelChannel, which can tell you the status of the current channel, together or off. Gets the channel-related configuration information. Get pipeline and so on. Are some of the overall information. The channel is naturally produced by ChannelFactory. The type of channel implementation determines whether you are synchronizing or asynchronous (NIO). For example, we use Nioserversocketchannel in our sample.



in the next article I will introduce Netty string reception.

The concept and working principle of Android Netty-based message push scheme (ii)

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.