Added a method to check if the server is running

NodeLookupReceiver
Only use the server if it's running
This commit is contained in:
Joshua Kissoon 2014-05-13 11:22:56 +05:30
parent 9e94a225fe
commit 807a9965d0
2 changed files with 11 additions and 3 deletions

View File

@ -349,4 +349,9 @@ public class KadServer
}
}
public boolean isRunning()
{
return this.isRunning;
}
}

View File

@ -51,9 +51,12 @@ public class NodeLookupReceiver implements Receiver
/* Respond to the NodeLookupMessage */
Message reply = new NodeReplyMessage(this.localNode.getNode(), nodes);
if (this.server.isRunning())
{
/* Let the Server send the reply */
this.server.reply(origin, reply, comm);
}
}
/**
* We don't need to do anything here