From 7552efee5c6d974087bc6883a5613d093ffd8bdc Mon Sep 17 00:00:00 2001 From: Tom Nichols Date: Wed, 12 May 2010 16:51:14 -0400 Subject: some reconnetion fixes --- sleekxmpp/xmlstream/xmlstream.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'sleekxmpp/xmlstream/xmlstream.py') diff --git a/sleekxmpp/xmlstream/xmlstream.py b/sleekxmpp/xmlstream/xmlstream.py index 025884b7..810be295 100644 --- a/sleekxmpp/xmlstream/xmlstream.py +++ b/sleekxmpp/xmlstream/xmlstream.py @@ -146,13 +146,19 @@ class XMLStream(object): def process(self, threaded=True): for t in range(0, HANDLER_THREADS): - self.__thread['eventhandle%s' % t] = threading.Thread(name='eventhandle%s' % t, target=self._eventRunner) - self.__thread['eventhandle%s' % t].start() - self.__thread['sendthread'] = threading.Thread(name='sendthread', target=self._sendThread) - self.__thread['sendthread'].start() + th = threading.Thread(name='eventhandle%s' % t, target=self._eventRunner) + th.setDaemon(True) + self.__thread['eventhandle%s' % t] = th + th.start() + th = threading.Thread(name='sendthread', target=self._sendThread) + th.setDaemon(True) + self.__thread['sendthread'] = th + th.start() if threaded: - self.__thread['process'] = threading.Thread(name='process', target=self._process) - self.__thread['process'].start() + th = threading.Thread(name='process', target=self._process) + th.setDaemon(True) + self.__thread['process'] = th + th.start() else: self._process() @@ -286,7 +292,7 @@ class XMLStream(object): self.state.set('tls',False) self.state.set('ssl',False) time.sleep(1) - self.connect() + self.connect(self.server,self.port) def incoming_filter(self, xmlobj): return xmlobj -- cgit v1.2.3