From 0f3fa27cef6cfb5e19f5ee01e55176d335d76f07 Mon Sep 17 00:00:00 2001 From: erickson Date: Thu, 18 Oct 2007 02:22:22 +0000 Subject: [PATCH] returning explicit true/false on data received git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1108 9efc2488-bf62-4759-914b-345cdb29e865 --- src/python/osrf/net.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/python/osrf/net.py b/src/python/osrf/net.py index 85afe47..a6fddf8 100644 --- a/src/python/osrf/net.py +++ b/src/python/osrf/net.py @@ -83,6 +83,8 @@ class osrfNetwork(JabberClient): JabberClient.__init__(self, self.jid, args['password'], args['host']) self.queue = [] + self.recvCallback = None + def connect(self): JabberClient.connect(self) while not self.isconnected: @@ -123,7 +125,8 @@ class osrfNetwork(JabberClient): """Attempts to receive a message from the network. timeout - max number of seconds to wait for a message. - If no message is received in 'timeout' seconds, None is returned. """ + If a message is received in 'timeout' seconds, the message is passed to + the recvCallback is called and True is returned. Otherwise, false is returned.""" msg = None if len(self.queue) == 0: @@ -140,7 +143,9 @@ class osrfNetwork(JabberClient): # if we've acquired a message, handle it if len(self.queue) > 0: self.recvCallback(self.queue.pop(0)) - return None + return True + + return False -- 2.11.0