Netty (c) Components introduction

Source: Internet
Author: User

Netty each component description:
Channel-----Socket
EventLoop-------Control Flow, multithreading, concurrency
Channelfuture-------Asynchronous notification

Channel
The main is to achieve socket I/O operation, reduce the complexity of the direct use of sockets, provide Embeddedchannel,localserverchannel,niosocketchannel and other implementations, can be selectively used;

EventLoop:
Is the core abstraction of Netty, which is used to handle events that occur during the life cycle of a connection. The Eventlloop is provided by Eventloopgroup.
A eventloopgroup can contain multiple eventloop; a eventloop is a tread thread that can be assigned to one or more channel;
A channel registers only one eventloop in the life cycle.

Channelfuture:
As a listening method for asynchronous callbacks, you can set up AddListener listening for operations such as callbacks after sending messages.

==============================================
(On EventLoop)
Channelhandler:
Serves as a container for application logic that handles all inbound and outbound data. conversion, encoding and decoding of data formats.
Commonly used have channelinboundhandler,channeloutboundhandler and so on.

Channelpileline:
is the container for the Channelhandler chain and defines the channelhandlercontext that is used to propagate the inbound and outbound event flows on the chain Api.channelpipleline is used to represent
The binding between Channelhandler and Channelpipleline, which is used to get the context.


==============================================
BootStrap and Serverbootstrap
Used to implement the binding of the application IP, port, and boot role.
BootStrap: For the client, requires a Eventlloopgroup
Serverbootstrap for the server, requires two eventloopgroup, a socket for serverchannel binding the port being monitored, and a channel for handling incoming client connections;

Netty (c) Components introduction

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.