From 2d93787b926cbfe1e9b33e66e1900613d320b090 Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Thu, 4 Jun 2015 20:14:08 +0100 Subject: handle the disconnection of the clients when a client disconnects, we must not try to send him a message since its socket is destroyed. However, a race condition can still probably occur if a client is disconnected during the handling of a request which leads to a notification. Signed-off-by: Olivier Gayot --- CAO_Client.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'CAO_Client.py') diff --git a/CAO_Client.py b/CAO_Client.py index b9da42a..bdcc000 100644 --- a/CAO_Client.py +++ b/CAO_Client.py @@ -61,3 +61,7 @@ class CAO_Client(): def send_notification(self, message): self.socket.send_message(self.handler, message) + + def disconnect(self): + if self.player is not None: + self.player.client = None -- cgit v1.2.3