ProcessOne SiteCustomer Helpdesk and FeedbackFollow us on Twitter
 
   
 
hosted.im idle timeout
Posted: 10 June 2012 06:16 PM   [ Ignore ]
Newbie
Rank
Total Posts:  1
Joined  2012-06-10

I am using strophe.js and creating bosh connection with my free hosted account at hosted.im.
What is the idle state timeout? I found in strophe demo app, user got disconnected after few second idle state.
How to reconnect ?

Profile
 
 
Posted: 12 June 2012 04:18 PM   [ Ignore ]   [ # 1 ]
Member
Avatar
RankRankRank
Total Posts:  63
Joined  2010-06-29

Hello Deepak,

i don’t know how the Strophe demo is written, if necessary, please post the code snippet on the idle handler you mention.
The idle state timeout is a callback designed to do “houskeeping” when the javascript thread is idle (approx. each 100 ms, depending on how busy the javascript thread is). According to the source code it does several things:

* remove timed handlers that have been scheduled for deletion
* add timed handlers scheduled for addition
* call ready timed handlers
* if no requests are in progress, poll (send a blank request, this is important)

See _onIdle() function.

By the way, make sure you are answering the ping IQ stanzas sent by hosted.IM. Example on Strophe:

on_ping : function(iq{
            
var pong $iq({
                to 
: $(iq).attr('from'),
                
type "result",
                
id : $(iq).attr('id')
            
});
            
connection.send(pong);
            return 
true;
        
},
 
               (...)

// XEP-0199 (ping) support.
connection.addHandler(Client.on_ping'urn:xmpp:ping''iq'); 
Profile