python-zk/kazoo — pull request #40 by blackwithwhite666 (2012-12-04 08:30:56+00:00)
Title: Handle TimeoutError in ConnectionHandler::_connect_loop

Should fix issue #37 and this exception:

```
Traceback (most recent call last):
File "kazoo/protocol/connection.py", line 444, in _connect_loop
connect_timeout)
File "kazoo/protocol/connection.py", line 572, in _send_request
self._submit(Ping, connect_timeout, PING_XID)
File "kazoo/protocol/connection.py", line 227, in _submit
self._write(int_struct.pack(len(b)) + b, timeout)
File "kazoo/protocol/connection.py", line 242, in _write
raise self.handler.timeout_exception("socket time-out")
TimeoutError: socket time-out
```

After time-out error (TimeoutError) state of session chaged to CONNECTING.