Browse Source

Melhorando quit

capellaresumo 6 years ago
parent
commit
e8b5df853c
1 changed files with 3 additions and 0 deletions
  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):