From: <mai...@gm...> - 2007-01-09 20:53:10
|
Is there a solution to catch this streamerror that the programm don't = crash? File "client.py", line 78, in main cl.Process(1) File "/usr/lib/python2.4/site-packages/xmpp/dispatcher.py", line 302, = in dispatch handler['func'](session,stanza) File "/usr/lib/python2.4/site-packages/xmpp/dispatcher.py", line 214, = in streamErrorHandler raise exc((name,text)) xmpp.protocol.SystemShutdown: (u'system-shutdown', '') I searched for a handler and others , but i didn't find anything. pex -----Urspr=FCngliche Nachricht----- Von: xmp...@li... [mailto:xmp...@li...] Im Auftrag von = Rafael Riester Gesendet: Dienstag, 9. Januar 2007 11:48 An: xmp...@li... Betreff: Re: [Xmpppy-devel] help wow, thanks..that's it! if i send in contant time intervalls to server, the connection keep = alive. I think the Problem are NAT timeouts. Thanks for the keepalive function. = i will test it! Thanks, pex -------- Original-Nachricht -------- Datum: Tue, 9 Jan 2007 11:00:31 +0100 Von: "Raf Nijskens" <rni...@gm...> An: xmp...@li... Betreff: Re: [Xmpppy-devel] help > On 1/9/07, Norman Rasmussen <no...@ra...> wrote: > > > > On 1/9/07, mai...@gm... <mai...@gm...> wrote: > > > The Client freeze an he can't recieve any messages or presence. = There > > are no > > > Debugging output. The code look likes: > > > The return of the Process ist allways string 0. > > > > My guess is that the connection was dropped, what the debug output > > just before the hang? Are you trapping the disconnect event, and > > reconnecting? > > > > -- > > - Norman Rasmussen > > - Email: no...@ra... > > - Home page: http://norman.rasmussen.co.za/ > > > > > = -------------------------------------------------------------------------= > > Take Surveys. Earn Cash. Influence the Future of IT > > Join SourceForge.net's Techsay panel and you'll get the chance to = share > > your > > opinions on IT & business topics through brief surveys - and earn = cash > > > = http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D= DEVDEV > > _______________________________________________ > > Xmpppy-devel mailing list > > Xmp...@li... > > https://lists.sourceforge.net/lists/listinfo/xmpppy-devel >=20 >=20 >=20 >=20 > Make sure you send an init presence. Indeed the Process function, = doesn't > keep the connection alive. Solution is to wright an keepalive = function: >=20 > init presence: >=20 > conn.sendInitPresence() >=20 > keepalive: >=20 > def keepalive(): > """Keeps jabber connection alive""" > global seconds > if int(time.strftime("%S")) =3D=3D seconds + 1: > CPMlib.conn.send(xmpp.protocol.Message(CPMlib.server,' ')) > global seconds > seconds+=3D1 > if seconds=3D=3D59: > global seconds > seconds=3D-01 > return >=20 >=20 > For reconnection: >=20 > conn.RegisterDisconnectHandler(disconnectHandler) >=20 > def disconnectHandler(): > """Reconnect to jabber server if connection is closed.""" > time.sleep(1) > CPMlib.conn.reconnectAndReauth() --=20 Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!=20 Ideal f=FCr Modem und ISDN: http://www.gmx.net/de/go/smartsurfer -------------------------------------------------------------------------= Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share = your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D= DEVDEV _______________________________________________ Xmpppy-devel mailing list Xmp...@li... https://lists.sourceforge.net/lists/listinfo/xmpppy-devel |