From 0c11b0293cffea3f2075fceb0fddf0602e3a6c86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torma=20Krist=C3=B3f?= Date: Sun, 25 Apr 2021 12:23:17 +0200 Subject: [PATCH] minor changes --- zmq/consumer.py | 3 ++- zmq/publisher.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/zmq/consumer.py b/zmq/consumer.py index e0be251..d5a98f0 100644 --- a/zmq/consumer.py +++ b/zmq/consumer.py @@ -16,6 +16,7 @@ try: while True: m = socket.recv_string() DATETIMES.append(datetime.now()) -except Exception: +except Exception as e: + print(e) socket.close() print(DATETIMES) \ No newline at end of file diff --git a/zmq/publisher.py b/zmq/publisher.py index 970531d..89a9262 100644 --- a/zmq/publisher.py +++ b/zmq/publisher.py @@ -9,9 +9,10 @@ context = zmq.Context() socket = context.socket(zmq.PUB) socket.bind("tcp://127.0.0.1:5559") +n = 10 +msg_body = "a" * n try: while True: - msg_body = "a" * m socket.send_string(f"test {msg_body}") except Exception: socket.close() \ No newline at end of file