users@glassfish.java.net

Re: Remote client does not fail fast

From: <glassfish_at_javadesktop.org>
Date: Wed, 27 Aug 2008 01:52:28 PDT

Hi

As I mentioned, I do my own check to see if the server is up before I do the lookup. Here is the code if you're interested:

private boolean IsHostUp(String host, Integer port) {
    try {
      Socket socket = new Socket(InetAddress.getByName(host),port);
      socket.close();
      return true;
    }
    catch(Exception e) {
      return false;
    }

  }
[Message sent by forum member 'eduardp' (eduardp)]

http://forums.java.net/jive/thread.jspa?messageID=295572