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

ARRUMEI O BUG

parent 8a00446f
No related branches found
No related tags found
No related merge requests found
......@@ -183,8 +183,14 @@ def server ():
msg, cliente = udp.recvfrom(1024)
protocolDescompactMessage.setDesempacota(msg)
#Recebi o token
if (protocolDescompactMessage.type == '0' and TOKEN == 0):
print 'RECEBI O TOKEN'
TOKEN = 1
StartTime = time.time()
#A msg foi enviada com sucesso
if (msg[1] == '2' and int(MACHINE_ID) == int(protocolDescompactMessage.destiny)):
elif (msg[1] == '2' and int(MACHINE_ID) == int(protocolDescompactMessage.destiny)):
print 'A MENSAGEM FOI ENVIADA COM SUCESSO'
RECEBIDA = 1
......@@ -205,7 +211,6 @@ def server ():
udp.sendto (msg, dest)
else:
print 'ERRO DE MENSAGEM'
#envia nack
protocolDescompactMessage.type = str(3)
protocolDescompactMessage.destiny = protocolDescompactMessage.origin
......@@ -216,11 +221,6 @@ def server ():
elif (msg[1] == '1' or msg[2] == '2' or msg[3] == '3'):
udp.sendto (msg, dest)
#Recebi o token
if (protocolDescompactMessage.type == '0' and TOKEN == 0):
print 'RECEBI O TOKEN'
TOKEN = 1
StartTime = time.time()
udp.close()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment