powered by Jive Software

IM gateway (AIM) - getting a socket closed on me

I’'m testing my bot and I can connect to the jabber server, send/receive messages and it looks all good.

Except when the connection sits idle then my bot gets a socket closed error from the jabber server.

Is the IM Gateway closing the socket after a timeout or is it just passing thru a AIM timeout close? To be honest I have no idea where to begin to debug this


Most likely the Openfire server itself is severing your connection. You have to send “pings” to the server so it knows you are still there. Typically this is accompished by sending a simple space (" ") to the server because it’‘s unparsed and ignored. There’‘s a config option somewhere (i think it’'s something like xmpp.client.idle or something) that tells openfire how long to wait before it severs and idle connection. Probably sending a ping every 5 minutes or every minute or something should be fine. Depending on your API it may even be doing that for you, not sure.

cool - that does sound like exactly the issue.

I had enabled debug logging on the server and could not see any packets from the AIM side prior to the disconnect and adding a simple “send presence update” event every 2 minutes solved the issue.

The API I use, just to babble , is the python xmpp library so I don’‘t think it’'s doing any keep-alive pinging for me.

thanks again!