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

arrumando erro de ack e nack

parent ff742c9f
No related branches found
No related tags found
No related merge requests found
......@@ -187,11 +187,11 @@ def server ():
RECEBIDA = 1
#Erro no envio
if (msg[1] == '3' and int(MACHINE_ID) == int(protocolDescompactMessage.destiny)):
elif (msg[1] == '3' and int(MACHINE_ID) == int(protocolDescompactMessage.destiny)):
RECEBIDA = 0
#A msg e pra mim
if (msg[1] == '1' and int(MACHINE_ID) == int(protocolDescompactMessage.destiny)):
elif (msg[1] == '1' and int(MACHINE_ID) == int(protocolDescompactMessage.destiny)):
#protocolDescompactMessage.crc = "8888888"#caga tdo
if (protocolDescompactMessage.crc == protocolDescompactMessage.getCRC32()):
print '\n' + protocolDescompactMessage.origin + ' Escreveu: ' + protocolDescompactMessage.msg
......@@ -211,7 +211,7 @@ def server ():
udp.sendto (msg, dest)
#A msg n e pra mim
elif (msg[1] == '1'):
elif (msg[1] == '1' or msg[2] == '2' or msg[3] == '3'):
udp.sendto (msg, dest)
#Recebi o token
......@@ -233,6 +233,8 @@ print 'ID Dessa maquina, escolha entre 1 e 4'
MACHINE_ID = raw_input ()
print "Ip da proxima maquina"
HOST = raw_input()
if TOKEN == 1:
StartTime = time.time()
threadServer = threading.Thread(target=server)
threadClient = threading.Thread(target=client)
threadToken = threading.Thread(target=token)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment