Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion dlt/py_dlt_receive.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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",
Expand All @@ -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,
Expand Down
Loading