views:

211

answers:

1

Hello, I am developing javascript XMPP application which uses Strophe library to connect to Jabber server. I need to engage the thread for about 5-10 seconds when Strophe connects to the server. Thread is engaged by running java applet and after it releases the thread it goes back to handle XMPP events, however at the moment I cannot manage to do that - trying to use a connection after delay gives me 404 HTTP error (this is sent by XMPP-BOSHS service straight after Strophe sends POST request with XMPP message to it). I was trying to 'pause' a connection with Strophe's connection.pause and then resume it - didn't work. Would sending some raw content to the server, maybe if it's possible telling it that client's gonna be unresponsive for a short time work ? Are there any other solutions ?

Thanks

+1  A: 

If the connection is established, you generally have 30-120 seconds to send a request before the session times out. A recent change to strophe fixed a bug here where it didn't respect the session timeout the server sent.

You'll get a 404 if your session has timed out. Do you have the timestamp and stanza for the last working stanza and the first non-working one? With those I can probably tell you what went wrong.

metajack
Thanks for response. I solved this time ago by reordering some code in my application and flushing the connection. Before that I was using old strophe which didn't have .flush() method. I was looking for some sort of "multithreading" solution and discovered that I can achieve similar results using suggested Javascript pattern - splitting the time consuming code into "peaces" and fire up those periodically from timed handler. We have to wait for Web Workers to take roots anyway :)
pk4r