From 51f0136c62497acc658e1d1943cbad930208a663 Mon Sep 17 00:00:00 2001 From: mart & charlie Date: Sun, 20 Dec 2015 15:18:37 -0500 Subject: [PATCH] final hello --- a3/code/jtorx/client/helloworld.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/a3/code/jtorx/client/helloworld.py b/a3/code/jtorx/client/helloworld.py index 3578d3e..e729e4b 100644 --- a/a3/code/jtorx/client/helloworld.py +++ b/a3/code/jtorx/client/helloworld.py @@ -48,14 +48,16 @@ if __name__ == "__main__": response = sender.sendInput("RP", seqnr, 0) sender.sendReset() if data == 'DAT?': - seqnr += 1 print 'DAT: {} sending: a'.format(seqnr) - response = sender.sendInput('PA', seqnr, sender.lastSeqReceived + 1, 'a') + response = sender.sendInput('A', seqnr, sender.lastSeqReceived + 1) + response = sender.sendInput('PA', seqnr, sender.lastSeqReceived + 1, data='a\n') + seqnr += 2 if response: + print 'response: {}'.format(response) if response == 'Timeout': print 'data: {} - TIMEOUT!'.format(data) conn.send('TIMEOUT!\n') - elif response[0] == 'A': + elif response[0] == 'A' or response[0] == 'PA': print 'data: {} - ACK!'.format(data) conn.send('ACK!\n') elif response[0] == 'R': -- 2.20.1