diff --git a/Chat.py b/Chat.py index d8b741e349e7c8c81bfb845ad6b1a94c7a446795..b2a0c3c83310695604bad700a37e7fe039c80f13 100755 --- a/Chat.py +++ b/Chat.py @@ -45,6 +45,7 @@ SEND_PORT = 3131 # Porta que o Servidor envia RECV_PORT = 3131 # Porta que o Servidor recebe class Protocol(): + def __init__ (self): self.marca = "~" #Marca self.type = str(1) #Alterar Depois @@ -123,13 +124,13 @@ def token (): dest = (HOST, SEND_PORT) while True: EndTime = time.time() - if (EndTime - StartTime >= 10 and TOKEN == 1): + if (EndTime - StartTime >= 2 and TOKEN == 1): print 'MANDEI O TOKEN' TOKEN = 0 tokenMessage.type = str(0) msg = tokenMessage.getEmpacotar() udp.sendto (msg,dest) - time.sleep(2) + #time.sleep(2) if (TOKEN == 1): #print 'ESTOU COM O TOKEN' if (not queue.empty()): @@ -154,7 +155,7 @@ def client (): protocolMessage.setDestiny() protocolMessage.setPriority() protocolMessage.setMessage() - protocolMessage.Type = str(1) + protocolMessage.type = str(1) protocolMessage.setSizeof() protocolMessage.setCRC32() msg = protocolMessage.getEmpacotar()