Java NIO Framework Netty Tutorial (ii) Vernacular concept

Source: Internet
Author: User

The code for "Hello World" is simple, but some of the important concepts (classes) and Netty need to be simple and clear, at least knowing what they are responsible for. Convenient for later use and expansion of more flexible.


Statement, the author of a Code of agriculture, not so many professional vocabulary and abbreviations, only the most simple pale words to describe the feelings and experience of the individual. If you think this is too unprofessional, I can only be sorry first. Then, the author has turned "Netty code Analysis", you can refer to.
Channelevent


First say this channelevent, because Netty is event-driven, that is what we mentioned above, what happens, we inform the "relevant departments." 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 (http://www.it165.net/pro/html/201207/3142.html), we deal with the event that is channelconnected. Later, we will also deal with more events.

Channelpipeline


Pipeline, translated into Chinese means: pipelines, transmission channels. In other words, he is here to control the distribution and delivery of channelevent events. Events in the pipeline flow, the first stop to where, the second stop to where, to where is the end, is to use this channelpipeline treatment. For example: development events. First give a design, then to b development. A flow chart, hoping to give you a more intuitive feeling.


Channelhandler
Just said pipeline responsible for the incident distribution to the corresponding site, the site in Netty, that is, refers to Channelhandler. The incident to the Channelhandler here, is to be specifically processed, our sample code (http://www.it165.net/pro/html/201207/3142.html), the implementation is such a processing event "site", In other words, your own business logic usually starts here.

Channel


With the coordination of a department, we also need an overall grasp of the situation, the so-called "bigger Picture" department, Channel.

Channel, 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.

These basic concepts, you understand.

Java NIO Framework Netty Tutorial (ii) Vernacular concept

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.