java.lang.Object
net.i2p.client.streaming.impl.I2PServerSocketFull
All Implemented Interfaces:
I2PServerSocket

class I2PServerSocketFullextends Object implements I2PServerSocket
Bridge to allow accepting new connections.
  • Field Details

    • _socketManager

      private final I2PSocketManagerFull _socketManager
      The manager that opened this listening socket.
  • Constructor Details

    • I2PServerSocketFull

      public I2PServerSocketFull(I2PSocketManagerFull mgr)
      Bridge to accept connections from the given manager.
      Parameters:
      mgr - the socket manager to accept connections from
  • Method Details

    • accept

      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() doesn't occur in some small period). Unlike a regular ServerSocket, a connection left unaccepted is answered with a streaming RESET and accept() reports the failure by throwing instead of returning null.
      Specified by:
      accept in interface I2PServerSocket
      Returns:
      a connected I2PSocket, never null
      Throws:
      I2PException - if there is a problem with reading a new socket from the data available (e.g. the I2PSession is closed)
      RouterRestartException - (extends I2PException) if the router is apparently restarting
      ConnectException - if the I2PServerSocket is closed, or if interrupted.
      SocketTimeoutException - if a timeout was previously set with setSoTimeout and the timeout has been reached.
    • getSoTimeout

      public long getSoTimeout()
      Current accept timeout.
      Specified by:
      getSoTimeout in interface I2PServerSocket
      Returns:
      the current timeout in milliseconds
    • setSoTimeout

      public void setSoTimeout(long x)
      Accept timeout in milliseconds.
      Specified by:
      setSoTimeout in interface I2PServerSocket
      Parameters:
      x - timeout in milliseconds
    • close

      public void close()
      Close the connection.
      Specified by:
      close in interface I2PServerSocket
    • getManager

      public I2PSocketManager getManager()
      Socket manager that owns this server socket.
      Specified by:
      getManager in interface I2PServerSocket
      Returns:
      the socket manager