net.i2p.client.streaming

## Interface I2PServerSocket

- All Known Implementing Classes:
    I2PServerSocketFull, I2PServerSocketImpl

      public interface I2PServerSocket

  Defines how to listen for streaming peer connections

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `I2PSocket` | `accept()` Waits for the next socket connecting.
    `void` | `close()` Closes the socket.
    `I2PSocketManager` | `getManager()` Access the manager which is coordinating the server socket
    `long` | `getSoTimeout()` Get Sock Option accept timeout
    `void` | `setSoTimeout(long x)` Set Sock Option accept timeout

- - ### Method Detail

    - #### close

          void close()
                     throws I2PException

      Closes the socket.
      Throws:
        `I2PException`

    - #### accept

          I2PSocket accept()
                           throws I2PException,
                                  ConnectException,
                                  SocketTimeoutException

      Waits for the next socket connecting. If a remote user tried to make a connection and the local application wasn't .accept()ing new connections, they should get refused (if .accept() doesnt occur in some small period). Warning - unlike regular ServerSocket, may return null.
      Returns:
        a connected I2PSocket OR NULL
      Throws:
        `I2PException` - if there is a problem with reading a new socket from the data available (aka the I2PSession closed, etc)
        `ConnectException` - if the I2PServerSocket is closed
        `SocketTimeoutException`

    - #### setSoTimeout

          void setSoTimeout(long x)

      Set Sock Option accept timeout
      Parameters:
        `x` - timeout in ms

    - #### getSoTimeout

          long getSoTimeout()

      Get Sock Option accept timeout
      Returns:
        timeout in ms

    - #### getManager

          I2PSocketManager getManager()

      Access the manager which is coordinating the server socket
      Returns:
        I2PSocketManager