flash.net.URLRequest 调用保持挂起 [英] flash.net.URLRequest call stays in pending

查看:17
本文介绍了flash.net.URLRequest 调用保持挂起的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个 flash/flex 应用程序,并且在调用 URLRequest 时出现问题.当调用服务器时,我得到的内容很好.在该内容存储在缓存中之后,下次 URLRequest 使用本地缓存来检索它.有时它可以工作,但有时调用永远不会完成 - 保持挂起.我正在使用最新的 Flash 播放器和不同的浏览器.在我的电脑上,我可以使用 chrome 复制问题,同事可以在 Firefox 上复制.我查看了 Flash Player 日志文件,当呼叫成功时和呼叫保持挂起状态时没有什么不同......

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 ...

我的朋友也无法复制这个问题,直到他将 Flash Player 升级到最新版本.

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

我相信这不是服务器端问题,因为 Web 服务器日志显示在问题发生时没有请求,并且 google chrome 中的网络工具确认该时间请求正在使用本地缓存.

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.

非常感谢!

责任代码:

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));

<小时>

更新:

现在我发现缓存不是它的责任.我每次在请求之前都清理了缓存,但仍然可以重现此错误.GET 请求仍显示为待处理,但这次我运行了wireshark,显示了有趣的结果 - 有问题的 GET 请求未登录到wireshark.这怎么可能?

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?

推荐答案

在嵌入 swf 的 .html 包装代码中,尝试将 allowScriptAccess="sameDomain" 更改为 allowScriptAccess="always".它出现了两次.

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

这篇关于flash.net.URLRequest 调用保持挂起的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆