Class LocalPortForwarder
java.lang.Object
net.schmizz.sshj.connection.channel.direct.LocalPortForwarder
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionLocalPortForwarder(Connection conn, Parameters parameters, ServerSocket serverSocket, LoggerFactory loggerFactory) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close the ServerSocket that's listening for connections to forward.booleanReturns whether this listener is running (ie. whether a thread is attached to it).voidlisten()Start listening for incoming connections and forward to remote host as a channel.voidStart listening for incoming connections and forward to remote host as a channel and ensure that the thread is registered.
-
Constructor Details
-
LocalPortForwarder
public LocalPortForwarder(Connection conn, Parameters parameters, ServerSocket serverSocket, LoggerFactory loggerFactory)
-
-
Method Details
-
listen
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
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 instanceis called from another thread- Throws:
IOException
-
close
Close the ServerSocket that's listening for connections to forward.- Throws:
IOException
-