Nio2Endpoint.Nio2Acceptor (Apache Tomcat 11.0.24 API Documentation)
Description: declaration: package: org.apache.tomcat.util.net, class: Nio2Endpoint, class: Nio2Acceptor

# Class Nio2Endpoint.Nio2Acceptor

java.lang.Object
org.apache.tomcat.util.net.Acceptor<AsynchronousSocketChannel>
org.apache.tomcat.util.net.Nio2Endpoint.Nio2Acceptor

All Implemented Interfaces:
  `Runnable, CompletionHandler<AsynchronousSocketChannel, Void>`

Enclosing class:
  `Nio2Endpoint`

protected class Nio2Endpoint.Nio2Acceptor extends Acceptor<AsynchronousSocketChannel> implements CompletionHandler<AsynchronousSocketChannel, Void>

- ## Nested Class Summary

  ### Nested classes/interfaces inherited from class Acceptor

  `Acceptor.AcceptorState`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected int`
  `errorDelay`

  ### Fields inherited from class Acceptor

  `state`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Nio2Acceptor(AbstractEndpoint<?, AsynchronousSocketChannel> endpoint)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `completed(AsynchronousSocketChannel socket, Void attachment)`
  `void`
  `failed(Throwable t, Void attachment)`
  `void`
  `run()`
  `void`
  `stopMillis(int waitMilliseconds)`
  Signals the Acceptor to stop.

  ### Methods inherited from class Acceptor

  `getState, handleExceptionWithDelay`

  ### Methods inherited from class Object

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

- ## Field Details

  - ### errorDelay

    protected int errorDelay

- ## Constructor Details

  - ### Nio2Acceptor

    public Nio2Acceptor(AbstractEndpoint<?, AsynchronousSocketChannel> endpoint)

- ## Method Details

  - ### run

    public void run()
    Specified by:
      `run` in interface `Runnable`
    Overrides:
      `run` in class `Acceptor<AsynchronousSocketChannel>`

  - ### stopMillis

    public void stopMillis(int waitMilliseconds)
    Signals the Acceptor to stop.
    Overrides:
      `stopMillis` in class `Acceptor<AsynchronousSocketChannel>`
    Parameters:
      `waitMilliseconds` - Ignored for NIO2.

  - ### completed

    public void completed(AsynchronousSocketChannel socket, Void attachment)
    Specified by:
      `completed` in interface `CompletionHandler<AsynchronousSocketChannel, Void>`

  - ### failed

    public void failed(Throwable t, Void attachment)
    Specified by:
      `failed` in interface `CompletionHandler<AsynchronousSocketChannel, Void>`