# HG changeset patch # User Matt Johnston # Date 1349539117 -28800 # Node ID 1603d0310dd0ff02bee507b3b7435d57ba2f0de9 # Parent b73ea78317dc77d42aa72355f48cf59579d6934f try to flush diff -r b73ea78317dc -r 1603d0310dd0 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':