diff --git a/dap/accumulator.py b/dap/accumulator.py index e539319..c3723e9 100644 --- a/dap/accumulator.py +++ b/dap/accumulator.py @@ -12,24 +12,25 @@ def main(): parser.add_argument("--accumulator_host", default="*") parser.add_argument("--accumulator_port", type=int, default=13000) - parser.add_argument("--bsread_port", type=int, default=None) #TODO: is the host needed? + parser.add_argument("--bsread_host", default="*") + parser.add_argument("--bsread_port", type=int, default=None) clargs = parser.parse_args() accumulator_addr = make_address(clargs.accumulator_host, clargs.accumulator_port) - accumulate(accumulator_addr, clargs.bsread_port) + accumulate(accumulator_addr, clargs.bsread_host, clargs.bsread_port) -def accumulate(accumulator_addr, bsread_port): +def accumulate(accumulator_addr, bsread_host, bsread_port): zmq_socks = ZMQSocketsAccumulator(accumulator_addr) output = FileHandler() sorter = Sorter() - sender = make_bsread_sender(bsread_port) + sender = make_bsread_sender(bsread_host, bsread_port) while True: if not zmq_socks.has_data(): diff --git a/dap/utils/bsreadext.py b/dap/utils/bsreadext.py index 2c1b4c2..bf321b9 100644 --- a/dap/utils/bsreadext.py +++ b/dap/utils/bsreadext.py @@ -1,10 +1,11 @@ from bsread.sender import Sender, PUB -def make_bsread_sender(bsread_port): +def make_bsread_sender(bsread_host="*", bsread_port=None): if not bsread_port: return None - sender = Sender(port=bsread_port, block=False, mode=PUB) + address = f"tcp://{bsread_host}" + sender = Sender(address=address, port=bsread_port, block=False, mode=PUB) sender.open() return sender