# HG changeset patch # User Matt Johnston # Date 1349539117 -28800 # Node ID 81591bdfa92c6073eccec40d8759f5c2fa033d2d # Parent bb0c946460f314c34d6568dbd281652bfd0d2f92 try to flush diff -r bb0c946460f3 -r 81591bdfa92c server/ts.py --- a/server/ts.py Sat Oct 06 23:53:28 2012 +0800 +++ b/server/ts.py Sat Oct 06 23:58:37 2012 +0800 @@ -42,8 +42,13 @@ return s +def flush(sock): + while readline(sock): + pass + @retry() def fetch(sock): + flush(sock) sock.send("fetch\n") crc = 0 @@ -94,6 +99,7 @@ if TESTING: return 99 L("Sending btoff") + flush(sock) sock.send("btoff\n"); # read newline l = readline(sock) @@ -121,6 +127,7 @@ @retry() def clear_meas(sock): + flush(sock) sock.send("clear\n"); l = readline(sock) if l and l.rstrip() == 'cleared':