|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface is required when a request for remote port forwarding is made. The methods enable you to establish a connection to the host and initialize the forwarding channel before it is opened.
Method Summary | |
SshTransport |
createConnection(java.lang.String hostToConnect,
int portToConnect)
Create a connection to the specified host. |
void |
initializeTunnel(SshTunnel tunnel)
Called once a connection has been established and a forwarding channel is about to be opened. |
Method Detail |
public SshTransport createConnection(java.lang.String hostToConnect, int portToConnect) throws SshException
hostToConnect
- portToConnect
-
SshException
SshTransport
public void initializeTunnel(SshTunnel tunnel)
public void initializeTunnel(SshTunnel tunnel) { tunnel.addChannelEventListener(new ChannelAdapter() { public void channelOpened(SshChannel channel) { // Cast the channel into a tunnel SshTunnel tunnel = (SshTunnel)channel; // Create a pair of IOStreamConnectors to transfer the data IOStreamConnector tx = new IOStreamConnector(); tx.connect(tunnel.getInputStream(), tunnel.getTransport().getOutputStream()); IOStreamConnector rx = new IOStreamConnector(); tx.connect(tunnel.getTransport().getInputStream(), tunnel.getOutputStream()); } }); }
tunnel
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |