1. Netty 3.x Source Analysishistorical

    Netty 3.x creates thread pools and initializes Boss and Worker components. These notes trace its networking implementation through thread organization.

  2. Summaryhistorical

    This page connects Netty source-analysis topics on server startup, Channel registration, and port binding through their call relationships.

  3. Off-Heap Memoryhistorical

    Off-heap memory lies outside the Java heap. These notes compare ByteBuffer allocation approaches and their relationship to data transfer.

  4. 2.56 1. Create NioEventLoopGrouphistorical

    NioEventLoopGroup manages multiple NioEventLoops and accepts Runnable tasks. These notes trace how the group is created through its constructors.

  5. 2. Bootstrap Creationhistorical

    After creating ServerBootstrap, Channel types, handlers, and options must be configured. These notes focus on how the Channel type is set.

  6. 3. Bind the Porthistorical

    These notes follow bind calls to examine how Netty port-binding requests reach the concrete Channel implementation.

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

  8. Pipeline Initializationhistorical

    Each Netty Channel has its own pipeline, created during AbstractChannel construction. These notes examine pipeline initialization.

  9. 1. Creating the Serverhistorical

    Starting from the server bind method, these notes follow the call chain to AbstractBootstrap.doBind and examine server creation.

  10. Create Executorhistorical

    These notes trace Netty Executor creation, starting with the thread factory and executor initialization.

  11. 2. Create NioSocketChannelhistorical

    Netty wraps accepted Java NIO connections in NioSocketChannel. These notes trace construction of that object and its parent classes.

  12. Adding and Removing ChannelHandlershistorical

    These notes begin with methods such as DefaultChannelPipeline.addLast and trace ChannelHandler insertion, validation, and removal.

  13. 2. Server Initializationhistorical

    These notes follow bind and doBind calls to trace the work performed during Netty server initialization.

  14. Create the NioEventLoop Arrayhistorical

    NioEventLoopGroup creates individual NioEventLoops through newChild. These notes follow that call to examine event-loop-array initialization.

  15. 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.

  16. 3. Register the Selectorhistorical

    Starting from the server's bind call, these notes trace how a Channel is assigned an event loop and registered with the Selector.

  17. 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.

  18. 4. Bind the Server Porthistorical

    These notes trace the server bind call chain to examine how Netty binds a listening port to the underlying network channel.

  19. Server Startuphistorical

    This page organizes Netty server-startup analysis into creation, initialization, Selector registration, and port binding.

  20. 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.

  21. 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.

  22. Inbound Eventshistorical

    Experiments with multiple InboundHandlers show how Netty inbound events propagate through the pipeline.

  23. ByteBufhistorical

    ByteBuf uses reader and writer indexes to divide consumed, readable, and writable regions. These notes examine read and write API behavior through those indexes.

  24. 2. Initialize Channelhistorical

    Channel initialization adds a ChannelInitializer to the pipeline and connects the handlers configured in ServerBootstrap.

  25. 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.

  26. Outbound Eventshistorical

    Code examples with multiple OutboundHandlers show how Netty outbound events propagate through the pipeline.

  27. ByteBufAllocatorhistorical

    ByteBufAllocator allocates ByteBuf instances. These notes follow the abstract buffer method to examine choices such as heap and direct memory.

  28. 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.

  29. Exception Eventshistorical

    Server and Handler examples generate exceptions to examine how Netty propagates and handles exception events in the pipeline.

  30. Usagehistorical

    Code examples record Netty memory-related usage and provide a practical starting point for reading allocator implementations.

  31. Channel Class Hierarchyhistorical

    Channel abstracts network I/O in Netty. These notes examine skeletal implementations and relationships among channel types through the class hierarchy.

  32. PooledByteBufAllocatorhistorical

    PooledByteBufAllocator obtains a thread cache and its PoolArena, then allocates memory through the arena. These notes trace both stages.

  33. PoolThreadCachehistorical

    PoolThreadCache creates caches for memory regions of different sizes. These notes examine initialization of tiny, small, and normal MemoryRegionCache instances.