3.绑定端口
Java · 7 notes
- 3. Bind the Porthistorical
These notes follow bind calls to examine how Netty port-binding requests reach the concrete Channel implementation.
- 2.79 1. Instantiate the Channelhistorical
Netty invokes the NioServerSocketChannel constructor through reflection and creates the underlying Java NIO channel. These notes trace that instantiation.
- Netty Bind Source: Actually Binding the Listening Porthistorical
Netty wraps port binding as a task for the Channel's NioEventLoop. These notes trace the calls after task submission.
- 2. Initialize Channelhistorical
Channel initialization adds a ChannelInitializer to the pipeline and connects the handlers configured in ServerBootstrap.
- Netty Source: NioEventLoop run Methodhistorical
NioEventLoop's run method repeatedly processes I/O events and tasks. These notes separate the main parts of the loop and trace execution.
- 2.91 3. Register the Channelhistorical
A server Channel uses EventLoopGroup to choose an event loop and register itself. These notes trace the process through ServerBootstrap calls.
- Channel Class Hierarchyhistorical
Channel abstracts network I/O in Netty. These notes examine skeletal implementations and relationships among channel types through the class hierarchy.