java.lang.Object
net.i2p.sam.SAMv3StreamSession.ConnectTask
All Implemented Interfaces:
Runnable
Enclosing class:
SAMv3StreamSession

private class SAMv3StreamSession.ConnectTaskextends Object implements Runnable
Runnable that performs the blocking I2P socket connect in a connector pool thread, then sets up pipes on success or reports the error to the SAM client.
  • Field Details

    • handler

      private final SAMv3Handler handler
      The handler that started the connect.
    • dest

      private final Destination dest
      The destination to connect to.
    • opts

      private final I2PSocketOptions opts
      Socket options for the connect.
    • verbose

      private final boolean verbose
      True for extra logging.
    • nick

      private final String nick
      Nickname of the session, for the logs.
  • Constructor Details

    • ConnectTask

      ConnectTask(SAMv3Handler handler, Destination dest, I2PSocketOptions opts, boolean verbose, String nick)
      Builds the connect task.
      Parameters:
      handler - the handler that started the connect
      dest - the destination to connect to
      opts - the socket options
      verbose - true for extra logging
      nick - the session nickname, for the logs
  • Method Details

    • run

      public void run()
      Connect to the requested destination and serve the connection until it closes.
      Specified by:
      run in interface Runnable
    • reportError

      private void reportError(String status, Exception e)
      Sends an error reply to the client.
      Parameters:
      status - the error status to send
      e - the exception to log, may be null