|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mindbright.ssh2.SSH2Listener
This class accepts connections to a single address/port pair for creating
channels through port forwards. It contains a thread which basically contains
an accept loop in which new connections are accepted and new channels are
created along with CHANNEL_OPEN messages to peer. There is one
SSH2Listener
instance for each local forward.
SSH2Connection
Constructor Summary | |
SSH2Listener(java.lang.String localAddr,
int localPort,
SSH2Connection connection)
Creates the remote listener for remote connections. |
|
SSH2Listener(java.lang.String localAddr,
int localPort,
java.lang.String remoteAddr,
int remotePort,
SSH2Connection connection,
SSH2StreamFilterFactory filterFactory)
Creates a listener for filtered connections. |
|
SSH2Listener(java.lang.String localAddr,
int localPort,
java.lang.String remoteAddr,
int remotePort,
SSH2Connection connection,
SSH2StreamFilterFactory filterFactory,
int acceptTimeout)
Creates a listener for filtered connections. |
Method Summary | |
void |
doConnect(java.net.Socket fwdSocket)
Handle a connect from the given socket. |
SSH2Connection |
getConnection()
|
java.lang.String |
getListenHost()
|
int |
getListenPort()
|
java.lang.String |
getRemoteHost()
|
int |
getRemotePort()
|
void |
run()
Run the listener and listen for connections. |
void |
sendChannelOpen(SSH2TCPChannel channel,
java.net.Socket fwdSocket)
Send a channel open for the given socket. |
void |
setAcceptMax(int acceptMax)
|
void |
setRetries(int numOfRetries)
|
void |
setRetryDelay(long retryDelayTime)
|
void |
setThreadPriority(int prio)
|
void |
stop()
Stop the listener. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SSH2Listener(java.lang.String localAddr, int localPort, java.lang.String remoteAddr, int remotePort, SSH2Connection connection, SSH2StreamFilterFactory filterFactory, int acceptTimeout) throws java.io.IOException
localAddr
- The address to open the listener to. should
normally be "127.0.0.1".localPort
- The local port to listen at.remoteAddr
- The remote address to connect to. Note that
this name is resolved on the server.remotePort
- The remote port to connect to.connection
- The connection to use.filterFactory
- Factory which creates filter
instances. There will be one filter created per connection.acceptTimeout
- Timeout for accept call.public SSH2Listener(java.lang.String localAddr, int localPort, java.lang.String remoteAddr, int remotePort, SSH2Connection connection, SSH2StreamFilterFactory filterFactory) throws java.io.IOException
localAddr
- The address to open the listener to. should
normally be "127.0.0.1".localPort
- The local port to listen at.remoteAddr
- The remote address to connect to. Note that
this name is resolved on the server.remotePort
- The remote port to connect to.connection
- The connection to use.filterFactory
- Factory which creates filter
instances. There will be one filter created per connection.public SSH2Listener(java.lang.String localAddr, int localPort, SSH2Connection connection) throws java.io.IOException
localAddr
- The address to open the listener to. should
normally be "127.0.0.1".localPort
- The local port to listen at.connection
- The connection to use.Method Detail |
public void run()
run
in interface java.lang.Runnable
public void doConnect(java.net.Socket fwdSocket)
fwdSocket
- A connected socket.public void sendChannelOpen(SSH2TCPChannel channel, java.net.Socket fwdSocket)
doConnect
once first
before calling this function.
channel
- The channel to retry to open on.fwdSocket
- Socket identifying the local end.public SSH2Connection getConnection()
public void setAcceptMax(int acceptMax)
public void setRetries(int numOfRetries)
public void setRetryDelay(long retryDelayTime)
public void setThreadPriority(int prio)
public int getListenPort()
public java.lang.String getListenHost()
public int getRemotePort()
public java.lang.String getRemoteHost()
public void stop()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |