Ejemplo n.º 1
0
 private boolean connectRetry() {
   int tries = MAX_RETRIES;
   boolean ok = false;
   while (!ok && tries > 0) {
     ErlLogger.debug("# ping..." + getNodeName() + " " + Thread.currentThread().getName());
     ok = localNode.ping(getNodeName(), RETRY_DELAY + (MAX_RETRIES - tries) * RETRY_DELAY % 3);
     tries--;
   }
   return ok;
 }
 private boolean canConnect(final String hostName) {
   if (hostName == null) {
     return false;
   }
   try {
     final OtpNode node = new OtpNode("jtest", "erlide");
     ErlLogger.debug("Ping: " + nodeName + "@" + hostName);
     final boolean result = node.ping(nodeName + "@" + hostName, 1000);
     node.close();
     return result;
   } catch (final IOException e) {
     ErlLogger.error(e);
   }
   return false;
 }