Skip to content

Commit 4a8205f

Browse files
committed
Refactor socket connection handling in BaseProcessorSocket to improve error management and remove redundant timeout setting
1 parent 77364ab commit 4a8205f

1 file changed

Lines changed: 1 addition & 11 deletions

File tree

dlclivegui/processors/dlc_processor_socket.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -209,12 +209,6 @@ def _accept_loop(self):
209209
try:
210210
conn = self.listener.accept()
211211

212-
# Apply safe timeout to client socket
213-
try:
214-
conn._socket.settimeout(self._socket_timeout)
215-
except Exception:
216-
pass
217-
218212
logger.debug(f"Client connected from {self.listener.last_accepted}")
219213
self.conns.add(conn)
220214

@@ -238,7 +232,7 @@ def _rx_loop(self, conn):
238232
self._handle_client_message(msg)
239233
continue
240234

241-
if getattr(conn._socket, "_closed", False):
235+
if conn.closed:
242236
raise EOFError
243237

244238
except (EOFError, OSError, ConnectionError, BrokenPipeError):
@@ -253,10 +247,6 @@ def _rx_loop(self, conn):
253247

254248
def _close_conn(self, conn):
255249
"""Force-close client connection."""
256-
try:
257-
conn._socket.shutdown(socket.SHUT_RDWR)
258-
except Exception:
259-
pass
260250
try:
261251
conn.close()
262252
except Exception:

0 commit comments

Comments
 (0)