* @throws ConnectionException if there is an error requesting the forwarding
* @throws TransportException
*/
public Forward bind(Forward forward, ConnectListener listener)
throws ConnectionException, TransportException {
SSHPacket reply = req(PF_REQ, forward);
if (forward.port == 0)
try {
forward.port = reply.readUInt32AsInt();
} catch (Buffer.BufferException e) {
throw new ConnectionException(e);
}
log.info("Remote end listening on {}", forward);
listeners.put(forward, listener);