public boolean requestRemoteForwarding ( String addressToBind , int portToBind , String hostToConnect , int portToConnect ) throws SshException { if ( ssh . requestRemoteForwarding ( addressToBind , portToBind , hostToConnect , portToConnect , forwardinglistener ) ) { String key = generateKey ( addressToBind , portToBind ) ; if ( ! incomingtunnels . containsKey ( key ) ) { incomingtunnels . put ( key , new Vector < ActiveTunnel > ( ) ) ; } remoteforwardings . put ( key , hostToConnect + ":" + portToConnect ) ; for ( int i = 0 ; i < clientlisteners . size ( ) ; i ++ ) { ( ( ForwardingClientListener ) clientlisteners . elementAt ( i ) ) . forwardingStarted ( ForwardingClientListener . REMOTE_FORWARDING , key , hostToConnect , portToConnect ) ; } return true ; } return false ; }
Requests that the remote side start listening for socket connections so that they may be forwarded to to the local destination .