Close the socket and context.
(self)
| 168 | self.socket.connect(address) |
| 169 | |
| 170 | def close(self): |
| 171 | """ |
| 172 | Close the socket and context. |
| 173 | """ |
| 174 | llm_logger.info("ZMQ client is closing connection...") |
| 175 | try: |
| 176 | if self.socket is not None and not self.socket.closed: |
| 177 | self.socket.setsockopt(zmq.LINGER, 0) |
| 178 | self.socket.close() |
| 179 | if self.context is not None: |
| 180 | self.context.term() |
| 181 | |
| 182 | except Exception as e: |
| 183 | llm_logger.warning(f"ZMQ client failed to close connection - {e}") |
| 184 | return |
nothing calls this directly
no test coverage detected