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