def request_port_forward(self, address, port, handler=None):
if not self.active:<EOL><INDENT>raise SSHException('<STR_LIT>')<EOL><DEDENT>address = str(address)<EOL>port = int(port)<EOL>response = self.global_request('<STR_LIT>', (address, port), wait=True)<EOL>if response is None:<EOL><INDENT>raise SSHException('<STR_LIT>')<EOL><DEDENT>if port == <NUM_LIT:0>:<EOL><INDENT>port = response.get_int()<EOL><DEDENT>if handler is None:<EOL><INDENT>def default_handler(channel, xxx_todo_changeme, xxx_todo_changeme1):<EOL><INDENT>(src_addr, src_port) = xxx_todo_changeme<EOL>(dest_addr, dest_port) = xxx_todo_changeme1<EOL>self._queue_incoming_channel(channel)<EOL><DEDENT>handler = default_handler<EOL><DEDENT>self._tcp_handler = handler<EOL>return port<EOL>
Ask the server to forward TCP connections from a listening port on
the server, across this SSH session.

If a handler is given, that handler is called from a different thread
whenever a forwarded connection arrives.  The handler parameters are::

    handler(channel, (origin_addr, origin_port), (server_addr, server_port))

where C{server_addr} and C{server_port} are the address and port that
the server was listening on.

If no handler is set, the default behavior is to send new incoming
forwarded connections into the accept queue, to be picked up via
L{accept}.

@param address: the address to bind when forwarding
@type address: str
@param port: the port to forward, or 0 to ask the server to allocate
    any port
@type port: int
@param handler: optional handler for incoming forwarded connections
@type handler: function(Channel, (str, int), (str, int))
@return: the port # allocated by the server
@rtype: int

@raise SSHException: if the server refused the TCP forward request