diff --git a/executorlib/standalone/interactive/communication.py b/executorlib/standalone/interactive/communication.py index 4fa224ac..1be6f13a 100644 --- a/executorlib/standalone/interactive/communication.py +++ b/executorlib/standalone/interactive/communication.py @@ -130,6 +130,13 @@ def shutdown(self, wait: bool = True): input_dict={"shutdown": True, "wait": wait} ) self._spawner.shutdown(wait=wait) + self._reset_socket() + return result + + def _reset_socket(self): + """ + Reset the socket and context of the SocketInterface instance. + """ if self._socket is not None: self._socket.close() if self._context is not None: @@ -137,7 +144,6 @@ def shutdown(self, wait: bool = True): self._process = None self._socket = None self._context = None - return result def __del__(self): """