I have a Flex application that runs in the browser and as standalone application with AIR. In our application, you can download a zip file which is generated at the server side containing a report. This zip file can be quite big (multiple GB) and takes a while to download. Basically, we do a HTTP POST from the client side:
m_file = new FileReference();
m_file.download( request, filename );
On the other hand, we send a ping from the client to the server each 15 seconds, to make sure the server is still there. The server responds to the ping with his name. When we do not get a response back in 30 seconds, we show the user a message that the server is down.
Now, the actual problem is that the ping request to the server never gets send while we are downloading the report. The strange thing is that this only happens in Adobe AIR on Windows. It is not a problem on Firefox on Windows. It is also not a problem with AIR on Mac OS X.
I have put some logging around the ping operation to show it:
[trace] 1: Mon Jul 16 16:00:20 GMT+0200 2012
[trace] return : 1: Mon Jul 16 16:00:20 GMT+0200 2012
[trace] 2: Mon Jul 16 16:00:35 GMT+0200 2012
[trace] return : 2: Mon Jul 16 16:00:35 GMT+0200 2012
[trace] 3: Mon Jul 16 16:00:50 GMT+0200 2012
[trace] return : 3: Mon Jul 16 16:00:50 GMT+0200 2012
[trace] 4: Mon Jul 16 16:01:05 GMT+0200 2012
[trace] 5: Mon Jul 16 16:01:20 GMT+0200 2012
[trace] 6: Mon Jul 16 16:01:35 GMT+0200 2012
[trace] 7: Mon Jul 16 16:01:50 GMT+0200 2012
[trace] fault 4: Mon Jul 16 16:02:05 GMT+0200 2012
[trace] fault 5: Mon Jul 16 16:02:05 GMT+0200 2012
[trace] fault 6: Mon Jul 16 16:02:05 GMT+0200 2012
[trace] fault 7: Mon Jul 16 16:02:05 GMT+0200 2012
[trace] 8: Mon Jul 16 16:02:05 GMT+0200 2012
[trace] fault 8: Mon Jul 16 16:02:20 GMT+0200 2012
[trace] 9: Mon Jul 16 16:02:21 GMT+0200 2012
Player session terminated
[AIR Debug Launcher]: Process finished with exit code 1
You can see that operation 1, 2 and 3 ran fine and returned immediately. At that point, we start the report download. Notice how operation 4 does not return immediately. After 15 seconds, operation 5 starts, then 6 and 7, each 15 seconds apart. Then suddenly, exactly after 1 minute, operation 4 returns into the fault handler as does all the other requests that where started during that 1 minute.
Note that in the background, the HTTP POST keeps running as long as the AIR app keeps running (checked with Charles). The ping request itself does not show up in charles, nor do I see them in the BlazeDS debug loggin if I enable that. It is like the AIR application never even tries to do the ping request on the server.
Is there anybody who has an idea what might be wrong? Any additional things I can check/debug?
I am using Flex SDK 4.5 and Adobe AIR 3.3