From: charlie Date: Mon, 25 Jan 2016 12:51:01 +0000 (+0100) Subject: shizzle iets aangepast X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=35444e483048f6ebeac4bbd3198862e0703d5304;p=tt2015.git shizzle iets aangepast --- diff --git a/a4/tcp/adapter/listener.py b/a4/tcp/adapter/listener.py index d64503b..a6d8999 100644 --- a/a4/tcp/adapter/listener.py +++ b/a4/tcp/adapter/listener.py @@ -20,6 +20,8 @@ if __name__ == "__main__": seqnr = 0 response = '' data = '' + has_error=False + did_syn=False while True: print 'waiting for data' done = False @@ -34,14 +36,25 @@ if __name__ == "__main__": print 'received: {}'.format(data) if data == 'RES': print 'resetting the SUT...' - #sender.sendReset() + sender.sendReset() sender = Sender(serverIP="127.0.0.1", networkInterface="lo", isLocal=True, serverPort=serverPort, waitTime=1, isVerbose=0) data = '' + has_error = False + did_syn = False continue - elif data == 'SYN': + elif has_error: + response = 'ERR' + elif data == 'SYN' and not did_syn: seqnr = 100 print 'S: {}'.format(seqnr) response = sender.sendInput('S', seqnr, seqnr) + did_syn = True + elif not did_syn: + response = 'ERR' + has_error = True + elif data == 'SYN': + response = 'ERR' + has_error = True elif data == 'ACK': response = 'Timeout' if sender.lastSeqReceived != None: diff --git a/a4/tcp/run.sh b/a4/tcp/run.sh index 645b4f8..cbda43f 100755 --- a/a4/tcp/run.sh +++ b/a4/tcp/run.sh @@ -1,3 +1,3 @@ #!/bin/bash -x #java -cp ":lib/automata-parent.jar:lib/learnlib-parent.jar" learner.Main small -java -cp ":lib/automata-parent.jar:lib/learnlib-parent.jar" learner.Main partial LStar rand +java -cp ":lib/automata-parent.jar:lib/learnlib-parent.jar" learner.Main partial TTT wm