org.klomp.snark

## Class PeerAcceptor

- java.lang.Object
- - org.klomp.snark.PeerAcceptor

-     class PeerAcceptor
      extends Object

  Accepts incomming connections from peers. The ConnectionAcceptor will call the connection() method when it detects an incomming BT protocol connection. The PeerAcceptor will then create a new peer if the PeerCoordinator wants more peers.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `PeerAcceptor.ProtocolException` A unique exception so we can tell the ConnectionAcceptor about non-BT connections

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `(package private) PeerCoordinatorSet` | `coordinators`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PeerAcceptor(PeerCoordinator coordinator)`
    `PeerAcceptor(PeerCoordinatorSet coordinators)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `connection(I2PSocket socket, InputStream in, OutputStream out)`

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

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

- - ### Field Detail

    - #### coordinators

          final PeerCoordinatorSet coordinators

  - ### Constructor Detail

    - #### PeerAcceptor

          public PeerAcceptor(PeerCoordinator coordinator)

    - #### PeerAcceptor

          public PeerAcceptor(PeerCoordinatorSet coordinators)

  - ### Method Detail

    - #### connection

          public void connection(I2PSocket socket,
                                 InputStream in,
                                 OutputStream out)
                          throws IOException

      Throws:
        `IOException`