Made changes in order to run under Python3.
Fixed bug that occurs only when server is dead.
Now raises catchable exception on connect fail.

Doc fix.