add socket connect timeout and recv timeout

This should really be returning a more specific kind of exception. Ideally, a `socket.timeout` exception like would be thrown for a connection timeout.