flash.net.URLRequest call stays in pending

前提是你 提交于 2019-12-12 01:39:53

问题


I've got this flash/flex application and issue with URLRequest call. When call is made to server I get content just fine. After that content is stored in cache and next time URLRequest uses local cache to retrieve it. Sometimes it works, but sometimes call is never finished - stays in pending. I'm using latest flash player and different browsers. On my computer I can replicate issue using chrome and colleague can replicate on firefox. I've looked at flash player log files and there's nothing different when call is successful and when call stays in pending ...

Also my friend couldn't replicate this issue until he upgraded flash player to latest version.

I believe this isn't a server-side issue because web server logs says there's no request at the time of the issue and network tool in google chrome confirmed that that time request is using local cache.

Currently I've resolved this by forcing client not to use cache using expiration date and no-cache, but I would like to use cache and I would like to understand why this happens.

Thanks a lot!

Responsible code:

loader = new utils.URLLoader();
loader.dataFormat = flash.net.URLLoaderDataFormat.BINARY;
loader.addEventListener(flash.events.Event.COMPLETE, this.onLoad);
loader.addEventListener(flash.events.IOErrorEvent.IO_ERROR, this.onErr);
loader.load(new flash.net.URLRequest(URL));

update:

Now I found out that cache isn't resposible for it. I've cleaned cache every time before a request and still I can reproduce this error. GET request is still displayed as pending, but this time I got wireshark running which shows interesting result - troubled GET request isn't logged in wireshark. How can this be possible?


回答1:


Be sure to listen to all kind of errors an URLLoader could dispatch : URLLoader's Adobe LiveDoc

If you're not in debug mode, some errors can be thrown but not caught and, therefore, stay silent.




回答2:


In the .html wrapper code that embeds your swf, try changing allowScriptAccess="sameDomain" to allowScriptAccess="always". It appears twice.



来源:https://stackoverflow.com/questions/7304967/flash-net-urlrequest-call-stays-in-pending

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!