From 4a67784fc70f3fcb70a97927bf4ecf97e5b89d4b Mon Sep 17 00:00:00 2001 From: Paulo Carvalho Date: Thu, 30 Jul 2026 14:08:26 +0100 Subject: [PATCH] Add configurable DLT port to py_dlt_receive `py_dlt_receive` always connect to the hardcoded `DLT_DAEMON_TCP_PORT` (3490) because the CLI never exposed a port option and passed nothing to `DLTBroker`. This adds a `--port` argument so a custom DLT daemon port can be used. --- dlt/py_dlt_receive.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/dlt/py_dlt_receive.py b/dlt/py_dlt_receive.py index b389645..0bdc3c2 100644 --- a/dlt/py_dlt_receive.py +++ b/dlt/py_dlt_receive.py @@ -5,7 +5,7 @@ import logging import time -from dlt.dlt import DLT_UDP_MULTICAST_FD_BUFFER_SIZE, DLT_UDP_MULTICAST_BUFFER_SIZE +from dlt.dlt import DLT_DAEMON_TCP_PORT, DLT_UDP_MULTICAST_FD_BUFFER_SIZE, DLT_UDP_MULTICAST_BUFFER_SIZE from dlt.dlt_broker import DLTBroker logging.basicConfig(format="%(asctime)s %(name)s %(levelname)-8s %(message)s") @@ -18,6 +18,12 @@ def parse_args(): logger.info("Parsing arguments") parser = argparse.ArgumentParser(description="Receive DLT messages") parser.add_argument("--host", required=True, help="hostname or ip address to connect to") + parser.add_argument( + "--port", + default=DLT_DAEMON_TCP_PORT, + type=int, + help=f"Port of the DLT Daemon to connect to. default: {DLT_DAEMON_TCP_PORT}", + ) parser.add_argument("--file", required=True, help="The file into which the messages will be written") parser.add_argument( "--udp-fd-buffer-size", @@ -41,6 +47,7 @@ def dlt_receive(options): logger.info("Creating DLTBroker instance") broker = DLTBroker( ip_address=options.host, + port=options.port, filename=options.file, udp_fd_buffer_size_bytes=options.udp_buffer_size, udp_buffer_size_bytes=options.udp_fd_buffer_size,