diff --git a/client.py b/client.py index e27d706..f7c5079 100644 --- a/client.py +++ b/client.py @@ -27,6 +27,7 @@ bufferSize = 8096 # buffer size in bytes timeout = 15 # timeout in seconds connection = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +unbufferedStdout = os.fdopen(sys.stdout.fileno(),"wb",0) # Make unbuffered stdout def listToCommand(lst): cmd = "" @@ -95,7 +96,7 @@ def main(): while True: data = connection.recv(bufferSize) if data == b"": return - sys.stdout.buffer.write(data) + unbufferedStdout.write(data) except: connection.close() raise @@ -112,4 +113,4 @@ def main(): raise if __name__ == '__main__': - main() \ No newline at end of file + main()