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