Package org.apache.tomcat.util.net

## 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 org.apache.tomcat.util.net.Acceptor

`Acceptor.AcceptorState`

### Field Summary

Fields
`protected int` `errorDelay`

### Fields inherited from class org.apache.tomcat.util.net.Acceptor

`state`

### Constructor Summary

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

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `completed​(AsynchronousSocketChannel socket, Void attachment)`
`void` `failed​(Throwable t, Void attachment)`
`void` `run()`
`void` `stop​(int waitSeconds)` Signals the Acceptor to stop.

### Methods inherited from class org.apache.tomcat.util.net.Acceptor

`getState, handleExceptionWithDelay`

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

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

### Field Detail

#### errorDelay

    protected int errorDelay

### Constructor Detail

#### Nio2Acceptor

    public Nio2Acceptor​(AbstractEndpoint<?,​AsynchronousSocketChannel> endpoint)

### Method Detail

#### run

    public void run()

Specified by:
  `run` in interface `Runnable`
Overrides:
  `run` in class `Acceptor<AsynchronousSocketChannel>`

#### stop

    public void stop​(int waitSeconds)

Signals the Acceptor to stop.

Overrides:
  `stop` in class `Acceptor<AsynchronousSocketChannel>`
Parameters:
  `waitSeconds` - 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>`