Merge pull request #274 from anton-ryzhov/fixes
Examples and thread counting
This commit is contained in:
commit
d002d4c06f
3 changed files with 3 additions and 3 deletions
|
@ -151,7 +151,7 @@ if __name__ == '__main__':
|
|||
#
|
||||
# if xmpp.connect(('talk.google.com', 5222)):
|
||||
# ...
|
||||
xmpp.process(block=False)
|
||||
xmpp.process(block=True)
|
||||
print("Done")
|
||||
else:
|
||||
print("Unable to connect.")
|
||||
|
|
|
@ -37,7 +37,7 @@ class PingTest(sleekxmpp.ClientXMPP):
|
|||
def __init__(self, jid, password, pingjid):
|
||||
sleekxmpp.ClientXMPP.__init__(self, jid, password)
|
||||
if pingjid is None:
|
||||
pingjid = self.jid
|
||||
pingjid = self.boundjid.bare
|
||||
self.pingjid = pingjid
|
||||
|
||||
# The session_start event will be triggered when
|
||||
|
|
|
@ -1343,12 +1343,12 @@ class XMLStream(object):
|
|||
return True
|
||||
|
||||
def _start_thread(self, name, target, track=True):
|
||||
self.__active_threads.add(name)
|
||||
self.__thread[name] = threading.Thread(name=name, target=target)
|
||||
self.__thread[name].daemon = self._use_daemons
|
||||
self.__thread[name].start()
|
||||
|
||||
if track:
|
||||
self.__active_threads.add(name)
|
||||
with self.__thread_cond:
|
||||
self.__thread_count += 1
|
||||
|
||||
|
|
Loading…
Reference in a new issue