public bool ping(String node, long timeout)
{
if (node.Equals(this.Node))
{
return true;
}
else if (node.IndexOf('@', 0) < 0 && node.Equals(this.Node.Substring(0, this.Node.IndexOf('@', 0))))
{
return true;
}
// other node
OtpMbox mbox = null;
try
{
mbox = createMbox(true);
mbox.send("net_kernel", node, getPingTuple(mbox));
OtpErlangObject reply = mbox.receive(timeout);
OtpErlangTuple t = (OtpErlangTuple)reply;
OtpErlangAtom a = (OtpErlangAtom)t.elementAt(1);
return "yes".Equals(a.atomValue());
}
catch (Exception)
{
}
finally
{
closeMbox(mbox);
}
return false;
}