From 8c2f90ec7c1843960f257eecff095f041d4d45ec Mon Sep 17 00:00:00 2001 From: Saksham Gera Date: Sat, 7 Jun 2025 00:03:16 +0530 Subject: [PATCH] Added A function to close all ports of zeromq running for a particular instance of concore --- concore.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/concore.py b/concore.py index 7b0b3b4..a06ecf8 100644 --- a/concore.py +++ b/concore.py @@ -54,6 +54,13 @@ def init_zmq_port(port_name, port_type, address, socket_type_str): except Exception as e: print(f"An unexpected error occurred during ZMQ port initialization for {port_name}: {e}") +def terminate_zmq(): + for port in zmq_ports.values(): + try: + port.socket.close() + port.context.term() + except Exception as e: + print(f"Error while terminating ZMQ port {port.address}: {e}") # --- ZeroMQ Integration End --- def safe_literal_eval(filename, defaultValue):