def start_client(self, event=None, timeout=None):
self.active = True<EOL>if event is not None:<EOL><INDENT>self.completion_event = event<EOL>self.start()<EOL>return<EOL><DEDENT>self.completion_event = event = threading.Event()<EOL>self.start()<EOL>max_time = time.time() + timeout if timeout is not None else None<EOL>while True:<EOL><INDENT>event.wait(<NUM_LIT:0.1>)<EOL>if not self.active:<EOL><INDENT>e = self.get_exception()<EOL>if e is not None:<EOL><INDENT>raise e<EOL><DEDENT>raise SSHException("<STR_LIT>")<EOL><DEDENT>if event.is_set() or (<EOL>timeout is not None and time.time() >= max_time<EOL>):<EOL><INDENT>break<EOL><DEDENT><DEDENT>
Negotiate a new SSH2 session as a client.  This is the first step after
creating a new `.Transport`.  A separate thread is created for protocol
negotiation.

If an event is passed in, this method returns immediately.  When
negotiation is done (successful or not), the given ``Event`` will
be triggered.  On failure, `is_active` will return ``False``.

(Since 1.4) If ``event`` is ``None``, this method will not return until
negotiation is done.  On success, the method returns normally.
Otherwise an SSHException is raised.

After a successful negotiation, you will usually want to authenticate,
calling `auth_password <Transport.auth_password>` or
`auth_publickey <Transport.auth_publickey>`.

.. note:: `connect` is a simpler method for connecting as a client.

.. note::
    After calling this method (or `start_server` or `connect`), you
    should no longer directly read from or write to the original socket
    object.

:param .threading.Event event:
    an event to trigger when negotiation is complete (optional)

:param float timeout:
    a timeout, in seconds, for SSH2 session negotiation (optional)

:raises:
    `.SSHException` -- if negotiation fails (and no ``event`` was
    passed in)