mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 09:02:15 -06:00
parallel socket shutdown
This commit is contained in:
parent
558bfa4e1e
commit
bc6234e032
|
@ -278,12 +278,12 @@ class HttpSrv(object):
|
|||
except:
|
||||
pass
|
||||
|
||||
thrs = []
|
||||
clients = list(self.clients)
|
||||
for cli in clients:
|
||||
try:
|
||||
cli.shutdown()
|
||||
except:
|
||||
pass
|
||||
t = threading.Thread(target=cli.shutdown)
|
||||
thrs.append(t)
|
||||
t.start()
|
||||
|
||||
if self.tp_q:
|
||||
self.stop_threads(self.tp_nthr)
|
||||
|
@ -292,6 +292,9 @@ class HttpSrv(object):
|
|||
if self.tp_q.empty():
|
||||
break
|
||||
|
||||
for t in thrs:
|
||||
t.join()
|
||||
|
||||
self.log(self.name, "ok bye")
|
||||
|
||||
def thr_client(self, sck: socket.socket, addr: tuple[str, int]) -> None:
|
||||
|
|
Loading…
Reference in a new issue