Search code examples
ajaxxmlhttprequestcometlong-polling

IE long-pooling with suspended connection XMLHttpRequest


I have a nice problem.

I have an application that suspend the request and stream data. The client will be IE6+ using long-polling.

With IE6 the XMLHttpRequest response data is only available in state==4. because my application is suspending the request for streaming data, I won't received state==4 until I resume the request, so I'll be stuck in state==3.

in Firefox or Chrome if I do abort() in state==3, it will switch to state==4 and quit nicely, but in IE, if I do abort(), the state will become ==0. and I'll never be in state==4.

I though of using a timeout, but look like the timeout doesn't exist in IE.

EDIT

I think, I can fix the problem, by passing a resumetimeout attribut in the request and create a timer in the server that will resume the connection.


Solution

  • with a Runnable in the server that will resume the request fix the limitation of IE.