Can you introduce a "ping" message that makes the remote machine go "pong"? The failure to receive a pong within a timeout will then be your clue.