[Opensrf-commits] r1108 - trunk/src/python/osrf
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Oct 17 22:35:12 EDT 2007
Author: erickson
Date: 2007-10-17 22:22:22 -0400 (Wed, 17 Oct 2007)
New Revision: 1108
Modified:
trunk/src/python/osrf/net.py
Log:
returning explicit true/false on data received
Modified: trunk/src/python/osrf/net.py
===================================================================
--- trunk/src/python/osrf/net.py 2007-10-18 01:11:10 UTC (rev 1107)
+++ trunk/src/python/osrf/net.py 2007-10-18 02:22:22 UTC (rev 1108)
@@ -83,6 +83,8 @@
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 @@
"""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 @@
# 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
+
More information about the opensrf-commits
mailing list