From d87247783dd32e9661de4e45129fe31b8bc4a269 Mon Sep 17 00:00:00 2001 From: Bastian Schroll Date: Fri, 20 Sep 2019 18:19:46 +0200 Subject: [PATCH] fix in TCPClient --- boswatch/network/client.py | 6 +++++- boswatch/processManager.py | 4 +--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/boswatch/network/client.py b/boswatch/network/client.py index 808ae51..7f9417a 100644 --- a/boswatch/network/client.py +++ b/boswatch/network/client.py @@ -103,5 +103,9 @@ class TCPClient: def isConnected(self): """!Property of client connected state""" if self._sock: - return True + try: + self._sock.sendall(bytes("", "utf-8")) + return True + except AttributeError: + pass return False diff --git a/boswatch/processManager.py b/boswatch/processManager.py index 918d69e..16b0dcf 100644 --- a/boswatch/processManager.py +++ b/boswatch/processManager.py @@ -73,8 +73,6 @@ class ProcessManager: self._processHandle.terminate() while self.isRunning: pass - else: - logging.debug("process not running: %s", self._args[0]) logging.debug("process %s returned %d", self._args[0], self._processHandle.returncode) def readline(self): @@ -91,7 +89,7 @@ class ProcessManager: return None def skipLines(self, line_cnt=1): - logging.debug("Skip %d lines from output", line_cnt) + logging.debug("skip %d lines from output", line_cnt) while line_cnt: self.readline() line_cnt -= 1