Fixed for windows (and 2.7)

Uses INET-sockets so that it works on Windows,

and passes on all exceptions other than socket.timeout, to work with Python 2.7