summaryrefslogtreecommitdiff
path: root/CAO_Client.py
diff options
context:
space:
mode:
authorOlivier Gayot <duskcoder@gmail.com>2015-06-04 20:14:08 +0100
committerOlivier Gayot <duskcoder@gmail.com>2015-06-04 20:14:08 +0100
commit2d93787b926cbfe1e9b33e66e1900613d320b090 (patch)
treee153c433729c95d09d786fd29b0399aedf8c88c5 /CAO_Client.py
parentc5f0a0b71a9f287006868da2e2209b0622164812 (diff)
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 <duskcoder@gmail.com>
Diffstat (limited to 'CAO_Client.py')
-rw-r--r--CAO_Client.py4
1 files changed, 4 insertions, 0 deletions
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