This looks racy.  How about setting a monitor on the server, and expect a 'DOWN' message within a given timeout instead?