public class PortForwarder extends java.lang.Thread implements java.io.Closeable, ListeningPort
Constructor and Description |
---|
PortForwarder(int localPort,
Forwarder forwarder) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Shuts down this port forwarder.
|
static ListeningPort |
create(VirtualChannel ch,
int acceptingPort,
Forwarder forwarder)
Starts a
PortForwarder accepting remotely at the given channel,
which connects by using the given connector. |
int |
getPort()
TCP/IP port that is listening.
|
void |
run() |
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
public PortForwarder(int localPort, Forwarder forwarder) throws java.io.IOException
java.io.IOException
public int getPort()
ListeningPort
getPort
in interface ListeningPort
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public void close() throws java.io.IOException
close
in interface ListeningPort
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException
public static ListeningPort create(VirtualChannel ch, int acceptingPort, Forwarder forwarder) throws java.io.IOException, java.lang.InterruptedException
PortForwarder
accepting remotely at the given channel,
which connects by using the given connector.Closeable
that can be used to shut the port forwarding down.java.io.IOException
java.lang.InterruptedException
Copyright © 2013. All Rights Reserved.