Class LocalPortForwarder
java.lang.Object
net.schmizz.sshj.connection.channel.direct.LocalPortForwarder
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Connectionprivate final org.slf4j.Loggerprivate final LoggerFactoryprivate final Parametersprivate Threadprivate final ServerSocket -
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.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.private voidstartChannel(Socket socket)
-
Field Details
-
loggerFactory
-
log
private final org.slf4j.Logger log -
conn
-
parameters
-
serverSocket
-
runningThread
-
-
Constructor Details
-
LocalPortForwarder
public LocalPortForwarder(Connection conn, Parameters parameters, ServerSocket serverSocket, LoggerFactory loggerFactory)
-
-
Method Details
-
startChannel
- Throws:
IOException
-
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
-