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