فهرست منبع

Melhorando quit

capellaresumo 6 سال پیش
والد
کامیت
e8b5df853c
1فایلهای تغییر یافته به همراه3 افزوده شده و 0 حذف شده
  1. 3 0
      tag.py

+ 3 - 0
tag.py

@@ -115,6 +115,7 @@ class TagServer(threading.Thread):
         return r
 
     def stop(self):
+        self.brodcast("STOP")
         self.mutex.acquire()
         clients_threads = self.clients_threads
         self.mutex.release()
@@ -259,6 +260,8 @@ class TagClient(threading.Thread):
                     print(d)
                     idd, interval = d[1].split(",")
                     self.tag = (int(idd), float(interval)+time.time())
+                elif d[0] == "QUIT":
+                    self.stop()
         self.sock.close()
 
     def getStatus(self):