Browse Source

fix port range arg

master
dave 4 years ago
parent
commit
aa6e53e2fa
  1. 8
      examples/ping.py
  2. 3
      msgbus/server.py

8
examples/ping.py

@ -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

3
msgbus/server.py

@ -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):

Loading…
Cancel
Save