revert change considering connection as idle

This commit is contained in:
benoitc 2023-07-19 00:10:24 +02:00
parent 4e12ebe334
commit bc905859a6

View File

@ -122,13 +122,10 @@ class ThreadWorker(base.Worker):
sock, client = listener.accept() sock, client = listener.accept()
# initialize the connection object # initialize the connection object
conn = TConn(self.cfg, sock, client, server) conn = TConn(self.cfg, sock, client, server)
# set timeout to ensure it will not be in the loop too long
conn.set_timeout()
self.nr_conns += 1 self.nr_conns += 1
# wait until socket is readable # wait until socket is readable
with self._lock: with self._lock:
self._keep.append(conn)
self.poller.register(conn.sock, selectors.EVENT_READ, self.poller.register(conn.sock, selectors.EVENT_READ,
partial(self.on_client_socket_readable, conn)) partial(self.on_client_socket_readable, conn))
except EnvironmentError as e: except EnvironmentError as e: