Class LocalPortForwarder

java.lang.Object
net.schmizz.sshj.connection.channel.direct.LocalPortForwarder

public class LocalPortForwarder extends Object
  • Field Details

    • loggerFactory

      private final LoggerFactory loggerFactory
    • log

      private final org.slf4j.Logger log
    • conn

      private final Connection conn
    • parameters

      private final Parameters parameters
    • serverSocket

      private final ServerSocket serverSocket
    • runningThread

      private Thread runningThread
  • Constructor Details

  • Method Details

    • startChannel

      private void startChannel(Socket socket) throws IOException
      Throws:
      IOException
    • listen

      public void listen() throws IOException
      Start listening for incoming connections and forward to remote host as a channel.
      Throws:
      IOException
    • isRunning

      public boolean isRunning()
      Returns whether this listener is running (ie. whether a thread is attached to it).
      Returns:
    • listen

      public void listen(Thread runningThread) throws IOException
      Start listening for incoming connections and forward to remote host as a channel and ensure that the thread is registered. This is useful if for instance is called from another thread
      Throws:
      IOException
    • close

      public void close() throws IOException
      Close the ServerSocket that's listening for connections to forward.
      Throws:
      IOException