Class LocalPortForwarder
java.lang.Object
net.schmizz.sshj.connection.channel.direct.LocalPortForwarder
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Connection
private final org.slf4j.Logger
private final LoggerFactory
private final Parameters
private Thread
private final ServerSocket
-
Constructor Summary
ConstructorsConstructorDescriptionLocalPortForwarder
(Connection conn, Parameters parameters, ServerSocket serverSocket, LoggerFactory loggerFactory) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close the ServerSocket that's listening for connections to forward.boolean
Returns whether this listener is running (ie.void
listen()
Start listening for incoming connections and forward to remote host as a channel.void
Start listening for incoming connections and forward to remote host as a channel and ensure that the thread is registered.private void
startChannel
(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
-