diff options
Diffstat (limited to '')
-rwxr-xr-x | test.d/dumb-client | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/test.d/dumb-client b/test.d/dumb-client index 0ee7331..e347f37 100755 --- a/test.d/dumb-client +++ b/test.d/dumb-client @@ -36,13 +36,14 @@ socket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) socket.connect(socket_path) def read_loop(): - data = socket.recv(1); - if not data: - return - sys.stdout.buffer.write(b'\033[34m'); - sys.stdout.buffer.write(data); - sys.stdout.buffer.write(b'\033[00m'); - sys.stdout.buffer.flush(); + while True: + data = socket.recv(2048); + if not data: + break + sys.stdout.buffer.write(b'\033[34m'); + sys.stdout.buffer.write(data); + sys.stdout.buffer.write(b'\033[00m'); + sys.stdout.buffer.flush(); thread = threading.Thread(target = read_loop) thread.setDaemon(True) |