Skip to content

Commit ea6585e

Browse files
authored
Merge pull request #221 from avinxshKD/fix-zmq-atexit
Register terminate_zmq with atexit to cleanup sockets on exit
2 parents 32e2c47 + 1c009f2 commit ea6585e

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

concore.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import time
22
import logging
33
import os
4+
import atexit
45
from ast import literal_eval
56
import sys
67
import re
@@ -112,6 +113,8 @@ def terminate_zmq():
112113
port.context.term()
113114
except Exception as e:
114115
logging.error(f"Error while terminating ZMQ port {port.address}: {e}")
116+
117+
atexit.register(terminate_zmq)
115118
# --- ZeroMQ Integration End ---
116119

117120

0 commit comments

Comments
 (0)