Skip to content

Commit

Permalink
Merge pull request #11 from brandoningli/Testing
Browse files Browse the repository at this point in the history
Changes from Testing
  • Loading branch information
brandoningli authored Mar 10, 2020
2 parents 58013e0 + ecb4a4c commit ee25455
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
## for lb4theartbeat
clientServer: lb4theartbeat/HeartbeatDriverClientServer.class lb4theartbeat/HeartbeatSharedData.class lb4theartbeat/Heartbeat.class lb4theartbeat/HeartbeatPacket.class lb4theartbeat/HearbeatReceive.class lb4theartbeat/HeartbeatSend.class lb4theartbeat/HeartbeatStatusPrinter.class lb4theartbeat/HeartbeatSummarySend.class
clientServer: lb4theartbeat/HeartbeatDriverClientServer.class lb4theartbeat/HeartbeatSharedData.class lb4theartbeat/Heartbeat.class lb4theartbeat/HeartbeatPacket.class lb4theartbeat/HeartbeatReceive.class lb4theartbeat/HeartbeatSend.class lb4theartbeat/HeartbeatStatusPrinter.class lb4theartbeat/HeartbeatSummarySend.class lb4theartbeat/NetIdentity.class
java lb4theartbeat.HeartbeatDriverClientServer lb4theartbeat/IPs.txt 150.243

clientServerJar: lb4theartbeat/HeartbeatDriverClientServer.class lb4theartbeat/HeartbeatSharedData.class lb4theartbeat/Heartbeat.class lb4theartbeat/HeartbeatPacket.class lb4theartbeat/HearbeatReceive.class lb4theartbeat/HeartbeatSend.class lb4theartbeat/HeartbeatStatusPrinter.class lb4theartbeat/HeartbeatSummarySend.class
clientServerJar: lb4theartbeat/HeartbeatDriverClientServer.class lb4theartbeat/HeartbeatSharedData.class lb4theartbeat/Heartbeat.class lb4theartbeat/HeartbeatPacket.class lb4theartbeat/HeartbeatReceive.class lb4theartbeat/HeartbeatSend.class lb4theartbeat/HeartbeatStatusPrinter.class lb4theartbeat/HeartbeatSummarySend.class lb4theartbeat/NetIdentity.class
mkdir -p jars
jar cfe jars/lb4theartbeatClientServer.jar lb4theartbeat.HeartbeatDriverClientServer lb4theartbeat/HeartbeatDriverClientServer.class lb4theartbeat/Heartbeat.class lb4theartbeat/HeartbeatPacket.class lb4theartbeat/HearbeatReceive.class lb4theartbeat/HeartbeatSend.class lb4theartbeat/HeartbeatStatusPrinter.class lb4theartbeat/HeartbeatSummarySend.class
jar cfe jars/lb4theartbeatClientServer.jar lb4theartbeat.HeartbeatDriverClientServer lb4theartbeat/HeartbeatDriverClientServer.class lb4theartbeat/Heartbeat.class lb4theartbeat/HeartbeatPacket.class lb4theartbeat/HeartbeatReceive.class lb4theartbeat/HeartbeatSend.class lb4theartbeat/HeartbeatStatusPrinter.class lb4theartbeat/HeartbeatSummarySend.class lb4theartbeat/NetIdentity.class lb4theartbeat/HeartbeatSharedData.class

peerToPeer: lb4theartbeat/HeartbeatDriverP2P.class lb4theartbeat/HeartbeatSharedData.class lb4theartbeat/Heartbeat.class lb4theartbeat/HeartbeatPacket.class lb4theartbeat/HearbeatReceive.class lb4theartbeat/HeartbeatSend.class lb4theartbeat/HeartbeatStatusPrinter.class lb4theartbeat/HeartbeatSummarySend.class
peerToPeer: lb4theartbeat/HeartbeatDriverP2P.class lb4theartbeat/HeartbeatSharedData.class lb4theartbeat/Heartbeat.class lb4theartbeat/HeartbeatPacket.class lb4theartbeat/HeartbeatReceive.class lb4theartbeat/HeartbeatSend.class lb4theartbeat/HeartbeatStatusPrinter.class lb4theartbeat/HeartbeatSummarySend.class lb4theartbeat/NetIdentity.class
java lb4theartbeat.HeartbeatDriverP2P lb4theartbeat/IPs.txt 150.243

peerToPeerJar: lb4theartbeat/HeartbeatDriverP2P.class lb4theartbeat/HeartbeatSharedData.class lb4theartbeat/Heartbeat.class lb4theartbeat/HeartbeatPacket.class lb4theartbeat/HearbeatReceive.class lb4theartbeat/HeartbeatSend.class lb4theartbeat/HeartbeatStatusPrinter.class lb4theartbeat/HeartbeatSummarySend.class
peerToPeerJar: lb4theartbeat/HeartbeatDriverP2P.class lb4theartbeat/HeartbeatSharedData.class lb4theartbeat/Heartbeat.class lb4theartbeat/HeartbeatPacket.class lb4theartbeat/HeartbeatReceive.class lb4theartbeat/HeartbeatSend.class lb4theartbeat/HeartbeatStatusPrinter.class lb4theartbeat/HeartbeatSummarySend.class lb4theartbeat/NetIdentity.class
mkdir -p jars
jar cfe jars/lb4theartbeatP2P.jar lb4theartbeat.HeartbeatDriverP2P lb4theartbeat/HeartbeatDriverP2P.class lb4theartbeat/Heartbeat.class lb4theartbeat/HeartbeatPacket.class lb4theartbeat/HearbeatReceive.class lb4theartbeat/HeartbeatSend.class lb4theartbeat/HeartbeatStatusPrinter.class lb4theartbeat/HeartbeatSummarySend.class
jar cfe jars/lb4theartbeatP2P.jar lb4theartbeat.HeartbeatDriverP2P lb4theartbeat/HeartbeatDriverP2P.class lb4theartbeat/Heartbeat.class lb4theartbeat/HeartbeatPacket.class lb4theartbeat/HeartbeatReceive.class lb4theartbeat/HeartbeatSend.class lb4theartbeat/HeartbeatStatusPrinter.class lb4theartbeat/HeartbeatSummarySend.class lb4theartbeat/NetIdentity.class lb4theartbeat/HeartbeatSharedData.class

## For exampleprogram
exampleServer: exampleprogram/Message.class exampleprogram/UDPServer.class
Expand Down
3 changes: 3 additions & 0 deletions lb4theartbeat/HeartbeatSend.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ public void run(){
beats.add(beat);
HeartbeatPacket packet = new HeartbeatPacket(data.isClientServerMode(), data.getIP(), beats);

// Update our local cache with this beat so we know we're stayin' alive
data.getHeartHash().put(data.getIP(), beat);

// Determine the highest priority alive server
String serverIP = data.getServerList().get(data.getServerList().size() - 1);
for(String ip : data.getServerList()){
Expand Down
7 changes: 7 additions & 0 deletions lb4theartbeat/HeartbeatSharedData.java
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,13 @@ public int getTTL() {
return this.TTL;
}
}
/**
* Gets the base TTL value
* @return bast TTL in number of seconds
*/
public int getBaseTTL(){
return this.TTL;
}
/**
* Sets TTL
* @param TTL
Expand Down
2 changes: 1 addition & 1 deletion lb4theartbeat/HeartbeatStatusPrinter.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public void run(){
System.out.println();

try{
Thread.sleep(sharedData.getMaxWait()*1000);
Thread.sleep(sharedData.getMaxWait()/3*1000);
} catch (InterruptedException e){
break;
}
Expand Down

0 comments on commit ee25455

Please sign in to comment.