Commit 76980a4a authored by Per Cederqvist's avatar Per Cederqvist
Browse files

Flush stdout more often. Give feedback on "#supsend socket" and

"#resume socket" to avoid a race condition.
parent 63d4b88b
......@@ -36,8 +36,10 @@ if len(sys.argv) > 3:
pfx = sys.argv[3] + ": "
metapfx = sys.argv[3] + "meta: "
print metapfx + "Connecting to", host, port
sys.stdout.flush()
s.connect((host, port))
print metapfx + "Connected"
sys.stdout.flush()
needpfx = 1
fdset = [s, sys.stdin]
while 1:
......@@ -54,6 +56,7 @@ while 1:
sys.exit(0)
else:
print metapfx + "EOF on socket"
sys.stdout.flush()
sys.stdin.readline()
sys.exit(0)
line = ""
......@@ -75,8 +78,12 @@ while 1:
sys.exit(1)
elif d == "#suspend socket\n":
fdset = [sys.stdin]
print metapfx + "suspended"
sys.stdout.flush()
elif d == "#resume socket\n":
fdset = [s, sys.stdin]
print metapfx + "resumed"
sys.stdout.flush()
elif d == "#hose socket\n":
s.send(string.zfill(0, 2000))
elif d[:6] == "#nocr ":
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment