Skip to content

Commit

Permalink
change ports
Browse files Browse the repository at this point in the history
  • Loading branch information
Xia committed Apr 12, 2019
1 parent f943d36 commit 515731d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@
addr = socket.gethostbyname(hostname)

# Open clients, on ports 9000+n
os.system("rm *.log")
num_clients = int(sys.argv[1])
for i in range(num_clients):
newpid = os.fork()
if newpid == 0:
port = 9000 + i
logfile = hostname + "_" + str(port) + ".log" # logfile: IP_PORT.log
os.system("./client " + str(9000+i) + " > " + logfile)
os.system("./client " + str(9900+i) + " > " + logfile)
break
else:
time.sleep(0.5)

0 comments on commit 515731d

Please sign in to comment.