diff --git a/fstream-client.py b/fstream-client.py index a77c350..856b4de 100644 --- a/fstream-client.py +++ b/fstream-client.py @@ -24,6 +24,7 @@ import threading import queue bufferSize = 1000 # buffer size in bytes +timeout = 15 # timeout in seconds connection = socket.socket(socket.AF_INET, socket.SOCK_STREAM) class stdoutThread(threading.Thread): @@ -33,7 +34,7 @@ class stdoutThread(threading.Thread): def run(self): while True: - data = self.queue.get() + data = self.queue.get(timeout=timeout) sys.stdout.buffer.write(data) def listToCommand(lst): @@ -59,7 +60,7 @@ def main(): serverAddr = sys.argv[1].rsplit(":",1) serverAddr[1] = int(serverAddr[1]) serverAddr = tuple(serverAddr) - connection.settimeout(15) + connection.settimeout(timeout) connection.connect(serverAddr) connection.sendall(makePayload(sys.argv[2:]))