From 85f11310a56528490106db05785943c816f21395 Mon Sep 17 00:00:00 2001 From: Oleksii Shevchuk Date: Wed, 5 Jul 2017 08:35:24 +0300 Subject: [PATCH] Fix bug with ping timeout --- pupy/network/lib/connection.py | 4 ++-- pupy/network/lib/servers.py | 2 +- pupy/pp.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pupy/network/lib/connection.py b/pupy/network/lib/connection.py index 16a9a086..6d2bcece 100644 --- a/pupy/network/lib/connection.py +++ b/pupy/network/lib/connection.py @@ -80,7 +80,7 @@ class PupyConnection(Connection): logging.debug('Sync poll serve interrupted: {}/inactive={}'.format( seq, self.inactive)) if self._ping: - self.ping(self._ping_timeout) + self.ping(timeout=self._ping_timeout) finally: if DEBUG_NETWORK: @@ -91,7 +91,7 @@ class PupyConnection(Connection): logging.debug('Sync poll wait: {}'.format(seq)) self._sync_events[seq].wait(timeout=self._serve_timeout) if self._ping: - self.ping(self._ping_timeout) + self.ping(timeout=self._ping_timeout) if DEBUG_NETWORK: logging.debug('Sync poll complete: {}/inactive={}'.format(seq, self.inactive)) diff --git a/pupy/network/lib/servers.py b/pupy/network/lib/servers.py index d415d319..71174e1e 100644 --- a/pupy/network/lib/servers.py +++ b/pupy/network/lib/servers.py @@ -155,7 +155,7 @@ class PupyTCPServer(ThreadedServer): while not connection.closed: connection.serve(interval or 10) if interval: - connection.ping(timeout) + connection.ping(timeout=timeout) except Empty: self.logger.debug('{}:{} Timeout'.format(h, p)) diff --git a/pupy/pp.py b/pupy/pp.py index 5d7d3c79..d628d776 100755 --- a/pupy/pp.py +++ b/pupy/pp.py @@ -736,7 +736,7 @@ def rpyc_loop(launcher): interval, timeout = conn.get_pings() conn.serve(interval or 10) if interval: - conn.ping(timeout) + conn.ping(timeout=timeout) except SystemExit: raise