commit 5dfba356b1d9ea21bd9c0691ce421946723165dc
Author: Ondrej Lichtner <olichtne(a)redhat.com>
Date: Thu Aug 21 14:25:27 2014 +0200
ConnectionHandler: check specific connections
This patch extends the ConnectionHandler class with functionality to
check specific connections for new messages instead of always checking
all of them.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
lnst/Common/ConnectionHandler.py | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/lnst/Common/ConnectionHandler.py b/lnst/Common/ConnectionHandler.py
index 042e78a..e8a6976 100644
--- a/lnst/Common/ConnectionHandler.py
+++ b/lnst/Common/ConnectionHandler.py
@@ -70,9 +70,15 @@ class ConnectionHandler(object):
self._connections = {}
def check_connections(self):
+ return self.check_connections_by_id(self._connections.keys())
+
+ def check_connections_by_id(self, connection_ids):
+ connections = []
+ for con_id in connection_ids:
+ connections.append(self._connections[con_id])
requests = []
try:
- rl, wl, xl = select.select(self._connections.values(), [], [], 0)
+ rl, wl, xl = select.select(connections, [], [], 0)
except select.error:
return []
for f in rl:
Show replies by date