Class LocalPortForwarder
- java.lang.Object
-
- net.schmizz.sshj.connection.channel.direct.LocalPortForwarder
-
public class LocalPortForwarder extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLocalPortForwarder.ForwardedChannel
-
Constructor Summary
Constructors Constructor Description LocalPortForwarder(Connection conn, Parameters parameters, java.net.ServerSocket serverSocket, LoggerFactory loggerFactory)
-
Method Summary
Modifier and Type Method Description voidclose()Close the ServerSocket that's listening for connections to forward.booleanisRunning()Returns whether this listener is running (ie.voidlisten()Start listening for incoming connections and forward to remote host as a channel.voidlisten(java.lang.Thread runningThread)Start listening for incoming connections and forward to remote host as a channel and ensure that the thread is registered.
-
-
-
Constructor Detail
-
LocalPortForwarder
public LocalPortForwarder(Connection conn, Parameters parameters, java.net.ServerSocket serverSocket, LoggerFactory loggerFactory)
-
-
Method Detail
-
listen
public void listen() throws java.io.IOExceptionStart listening for incoming connections and forward to remote host as a channel.- Throws:
java.io.IOException
-
isRunning
public boolean isRunning()
Returns whether this listener is running (ie. whether a thread is attached to it).- Returns:
-
listen
public void listen(java.lang.Thread runningThread) throws java.io.IOExceptionStart 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:
java.io.IOException
-
close
public void close() throws java.io.IOExceptionClose the ServerSocket that's listening for connections to forward.- Throws:
java.io.IOException
-
-