diff --git a/Simulation/simulation.sh b/Simulation/simulation.sh index 5dd43cd..eea9c74 100644 --- a/Simulation/simulation.sh +++ b/Simulation/simulation.sh @@ -57,6 +57,7 @@ Start_all_instances() { # Start P2PRC as background process p2prc -s & pids+=($!) + sleep 3 cd .. done } @@ -100,20 +101,20 @@ unset P2PRC # Run with 2 nodes P2PRC_instances 3 -# Start instances +## Start instances Start_all_instances 3 +# +## Delay for instances to run -# Delay for instances to run -sleep 6 - -# update all instances ip table -#Update_All_IP_Tables 3 - -# List ip tables of nodes started +# +## update all instances ip table +##Update_All_IP_Tables 3 +# +## List ip tables of nodes started IP_Tables_after_Started 3 - -# Remove test files created +# +## Remove test files created Remove_all_test_files - -# Kill all instances +# +## Kill all instances Kill_all_instances diff --git a/client/clientIPTable/Iptable.go b/client/clientIPTable/Iptable.go index 6a56cd4..6b6967a 100644 --- a/client/clientIPTable/Iptable.go +++ b/client/clientIPTable/Iptable.go @@ -118,7 +118,7 @@ func UpdateIpTableListClient() error { Exists := false // If the address is local then add to the local list - if currentIPV4 == Addresses.IpAddress[j].Ipv4 && Addresses.IpAddress[j].ServerPort == Config.ServerPort { + if (currentIPV4 == Addresses.IpAddress[j].Ipv4 && !Config.Test) && Addresses.IpAddress[j].ServerPort == Config.ServerPort { Exists = true } @@ -136,11 +136,12 @@ func UpdateIpTableListClient() error { } w.Add(1) - if Addresses.IpAddress[j].Ipv6 != "" { - go UpdateIpTable(Addresses.IpAddress[j].Ipv6, Addresses.IpAddress[j].ServerPort, &w) - } else if Addresses.IpAddress[j].Ipv4 != currentIPV4 { - go UpdateIpTable(Addresses.IpAddress[j].Ipv4, Addresses.IpAddress[j].ServerPort, &w) - } + //if Addresses.IpAddress[j].Ipv6 != "" { + // go UpdateIpTable(Addresses.IpAddress[j].Ipv6, Addresses.IpAddress[j].ServerPort, &w) + //} else if Addresses.IpAddress[j].Ipv4 != currentIPV4 { + // //go UpdateIpTable(Addresses.IpAddress[j].Ipv4, Addresses.IpAddress[j].ServerPort, &w) + //} + go UpdateIpTable(Addresses.IpAddress[j].Ipv4, Addresses.IpAddress[j].ServerPort, &w) w.Wait() //Appends server1 IP address to variable DoNotRead