Skip to content
Snippets Groups Projects
Commit 1c286de8 authored by Fernando Erd's avatar Fernando Erd :ok_hand:
Browse files

arrumado erro, talvez

parent 2b70fed1
No related branches found
No related tags found
No related merge requests found
...@@ -45,6 +45,7 @@ SEND_PORT = 3131 # Porta que o Servidor envia ...@@ -45,6 +45,7 @@ SEND_PORT = 3131 # Porta que o Servidor envia
RECV_PORT = 3131 # Porta que o Servidor recebe RECV_PORT = 3131 # Porta que o Servidor recebe
class Protocol(): class Protocol():
def __init__ (self): def __init__ (self):
self.marca = "~" #Marca self.marca = "~" #Marca
self.type = str(1) #Alterar Depois self.type = str(1) #Alterar Depois
...@@ -123,13 +124,13 @@ def token (): ...@@ -123,13 +124,13 @@ def token ():
dest = (HOST, SEND_PORT) dest = (HOST, SEND_PORT)
while True: while True:
EndTime = time.time() EndTime = time.time()
if (EndTime - StartTime >= 10 and TOKEN == 1): if (EndTime - StartTime >= 2 and TOKEN == 1):
print 'MANDEI O TOKEN' print 'MANDEI O TOKEN'
TOKEN = 0 TOKEN = 0
tokenMessage.type = str(0) tokenMessage.type = str(0)
msg = tokenMessage.getEmpacotar() msg = tokenMessage.getEmpacotar()
udp.sendto (msg,dest) udp.sendto (msg,dest)
time.sleep(2) #time.sleep(2)
if (TOKEN == 1): if (TOKEN == 1):
#print 'ESTOU COM O TOKEN' #print 'ESTOU COM O TOKEN'
if (not queue.empty()): if (not queue.empty()):
...@@ -154,7 +155,7 @@ def client (): ...@@ -154,7 +155,7 @@ def client ():
protocolMessage.setDestiny() protocolMessage.setDestiny()
protocolMessage.setPriority() protocolMessage.setPriority()
protocolMessage.setMessage() protocolMessage.setMessage()
protocolMessage.Type = str(1) protocolMessage.type = str(1)
protocolMessage.setSizeof() protocolMessage.setSizeof()
protocolMessage.setCRC32() protocolMessage.setCRC32()
msg = protocolMessage.getEmpacotar() msg = protocolMessage.getEmpacotar()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment