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

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

View File

@ -51,8 +51,11 @@ public class NodeLookupReceiver implements Receiver
/* Respond to the NodeLookupMessage */
Message reply = new NodeReplyMessage(this.localNode.getNode(), nodes);
/* Let the Server send the reply */
this.server.reply(origin, reply, comm);
if (this.server.isRunning())
{
/* Let the Server send the reply */
this.server.reply(origin, reply, comm);
}
}
/**