Rewrite the socket engine to throw a SocketException if we fail to connect or maintain a connection (prevents an infinite iteration bug)