net.i2p.client.streaming

## Class AcceptingChannel

- java.lang.Object
- - java.nio.channels.spi.AbstractInterruptibleChannel
  - - java.nio.channels.SelectableChannel
    - - net.i2p.client.streaming.AcceptingChannel

- All Implemented Interfaces:
    Closeable, AutoCloseable, Channel, InterruptibleChannel

      public abstract class AcceptingChannel
      extends SelectableChannel

  As this does not (yet) extend ServerSocketChannel it cannot be returned by StandardServerSocket.getChannel(), until we implement an I2P SocketAddress class. Warning, this interface and implementation is preliminary and subject to change without notice. Unimplemented, unlikely to ever be implemented.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected I2PSocketManager` | `_socketManager` Socket manager for this channel

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `AcceptingChannel(I2PSocketManager manager)` Create a new accepting channel.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected abstract I2PSocket` | `accept()` Accept an incoming connection.

    - ### Methods inherited from class java.nio.channels.SelectableChannel

      `blockingLock, configureBlocking, isBlocking, isRegistered, keyFor, provider, register, register, validOps`

    - ### Methods inherited from class java.nio.channels.spi.AbstractInterruptibleChannel

      `begin, close, end, implCloseChannel, isOpen`

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

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

    - ### Methods inherited from interface java.nio.channels.Channel

      `close, isOpen`

- - ### Field Detail

    - #### _socketManager

          protected final I2PSocketManager _socketManager

      Socket manager for this channel

  - ### Constructor Detail

    - #### AcceptingChannel

          protected AcceptingChannel(I2PSocketManager manager)

      Create a new accepting channel.
      Parameters:
        `manager` - the socket manager

  - ### Method Detail

    - #### accept

          protected abstract I2PSocket accept()
                                       throws I2PException,
                                              ConnectException

      Accept an incoming connection.
      Returns:
        the accepted I2P socket
      Throws:
        `I2PException` - if an I2P error occurs
        `ConnectException` - if a connection error occurs