Connection Timeout Extension/Detection
- by ircmaxell
Well, let me start off by explaining what I'm trying to do. I have an application that stalls a HTTP connection until new data is available (sometimes a few seconds, sometimes 30 minutes or so). Right now, the system works fine if the data is sent within a few minutes.
The problem I'm facing, is that it doesn't seem that XHR recognizes a dropped connection... So instead of killing the current connection and reconnecting when it detects a dropped connection, it just sits there. I'd really not like to have it force-reconnect every minute or two (That's one reason this app was written, to stop the need for polling).
So, my questions are as follows:
Is there a way to detect a dropped (not closed) TCP connection with XHR?
Is there a way that I can tell XHR not to timeout (I saw IE8 has the .timeout property)
Would it be better to send a header (or some other content) every now and then (say once per minute) down the pipe to keep the connection open?
Thanks.