_terminate_client_handlers uses "for" cycle for clients disconnecting:
for client in self.clients:
self._terminate_client_handler(client["handler"])
It executes _clientleft as finish(), there client is removed form self.clients list. It leads to an index shift and second client in list will be not disconnected.
For example:
_terminate_client_handlers uses "for" cycle for clients disconnecting:
It executes _clientleft as finish(), there client is removed form self.clients list. It leads to an index shift and second client in list will be not disconnected. For example:
Result: before disconnect
Possible fix: