From 06549b8e261cc182cd4cb7d0b9df4ffdd1a67f49 Mon Sep 17 00:00:00 2001 From: Bastian Schroll Date: Sun, 20 Oct 2019 19:07:16 +0200 Subject: [PATCH] some improvements --- boswatch/network/client.py | 2 ++ networking.py | 0 test/boswatch/test_ServerClient.py | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 networking.py diff --git a/boswatch/network/client.py b/boswatch/network/client.py index 0c2909b..7c8cd3c 100644 --- a/boswatch/network/client.py +++ b/boswatch/network/client.py @@ -109,5 +109,7 @@ class TCPClient: self._sock.sendall(bytes(header + aliveMsg, "utf-8")) return True except socket.error as e: + if e.errno is 32: # broken pipe - no one will read from this pipe anymore + return False logging.error(e) return False diff --git a/networking.py b/networking.py new file mode 100644 index 0000000..e69de29 diff --git a/test/boswatch/test_ServerClient.py b/test/boswatch/test_ServerClient.py index c6b4f80..fecb1ae 100644 --- a/test/boswatch/test_ServerClient.py +++ b/test/boswatch/test_ServerClient.py @@ -173,7 +173,7 @@ def test_serverStopsWhileConnected(getRunningServer, getClient): getRunningServer.stop() timeout = 10 while getClient.isConnected: - print(timeout) + time.sleep(0.1) timeout = timeout - 1 if timeout is 0: assert 0