fix port range arg

This commit is contained in:
dave 2017-09-17 20:45:57 -07:00
parent 685ff6b02b
commit aa6e53e2fa
2 changed files with 9 additions and 2 deletions

View File

@ -31,7 +31,13 @@ def ping(host, port, count=5, interval=1):
_, msg = client.recv()
recvtime = time()
seq, msgtime, remotetime = msg.split(" ")
print("ping(): < {} {} rtt: {:f}\n".format(_, seq, round(recvtime - float(msgtime), 8)))
msgtime = float(msgtime)
remotetime = float(remotetime)
transittime = recvtime - msgtime
# out = remotetime - msgtime
# back = recvtime - remotetime
# These aren't printed because clock sync imperfection makes them unreliable
print("ping(): < {} {} rtt: {:f}\n".format(_, seq, round(transittime, 8)))
recv = Thread(target=ping_recver)
recv.daemon = True

View File

@ -348,8 +348,9 @@ def main():
with zmq.asyncio.Context() as ctx:
loop = asyncio.get_event_loop()
# loop.set_debug(True)
port_range = (int(args.port_range[0]), int(args.port_range[1]))
server = MsgBusServer(loop, ctx, args.bind_host, int(args.port), int(args.port) + 1,
port_range=args.port_range, peers=args.peers if args.peers else [],
port_range=port_range, peers=args.peers if args.peers else [],
name=args.name)
def signal_handler(signum, stack):