4.新连接的接入
Java · 4 notes
- 1. Detect a New Connectionhistorical
When a connection arrives, NioEventLoop handles an OP_ACCEPT event. These notes trace connection detection with breakpoints and a client connection.
- 2. Create NioSocketChannelhistorical
Netty wraps accepted Java NIO connections in NioSocketChannel. These notes trace construction of that object and its parent classes.
- 3. Allocate a Thread and Register the Selectorhistorical
After a new connection passes through the pipeline, it needs a processing thread and Selector registration. These notes trace the related calls from connection acceptance.
- 4. Register Read Events with the Selectorhistorical
After Channel registration, read events must be registered with the Selector. These notes trace the process through AbstractChannel's register operation.