net.i2p.router.transport.ntcp

## Class NTCPSendFinisher

- java.lang.Object
- - net.i2p.router.transport.ntcp.NTCPSendFinisher

-     class NTCPSendFinisher
      extends Object

  Handles asynchronous post-send processing of OutNetMessage using a fixed-size thread pool executor with a bounded queue and backpressure. Provides efficient message serialization and prevents resource exhaustion.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `NTCPSendFinisher(I2PAppContext context, NTCPTransport transport)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `add(OutNetMessage msg)` Adds a message to the finishing queue to call afterSend asynchronously.
    `void` | `start()` Starts the thread pool executor for processing send finish tasks.
    `void` | `stop()` Stops the thread pool executor, waiting briefly for termination.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### NTCPSendFinisher

          public NTCPSendFinisher(I2PAppContext context,
                                  NTCPTransport transport)

  - ### Method Detail

    - #### add

          public void add(OutNetMessage msg)

      Adds a message to the finishing queue to call afterSend asynchronously. If the executor is stopped or saturated, falls back to caller running the task.

    - #### start

          public void start()

      Starts the thread pool executor for processing send finish tasks.

    - #### stop

          public void stop()

      Stops the thread pool executor, waiting briefly for termination.