AS3:来自 Flash 的 http Web 请求超时或永远不会“返回”

发布于 2024-10-18 05:50:12 字数 349 浏览 1 评论 0原文

我运行一个 facebook 游戏,它使用 AS3 的 URLRequest 和 URLLoader 类向我的服务器发出 http web 请求,然后获取服务器返回的 json 数据并对其进行处理,等等。

最近,我有用户抱怨服务器请求永远不会回来。他们表演并采取行动,而游戏就有点挂在那里,无限期地等待响应。如果只是时不时地出现,我会把它归咎于服务器经常掉球,但有些用户抱怨这个问题始终出现在同一个确切的位置,而其他用户则根本不明白。

最让我困扰的部分是,无论我做什么,我都无法重现他们遇到的问题。我怎样才能诊断这个问题而不受到它的影响?我很困惑。

你们知道可能会发生什么吗?或者我可以做些什么来获取有关可能发生的情况的更多信息?谢谢。

I run a facebook game that makes http web requests to my server using AS3's URLRequest and URLLoader classes, then takes the json data that the server spits back and and processes it it, etc etc..

Lately I've had users complaining about server requests that never come back. They perform and action and the game just kinda hangs there waiting for a response indefinitely. If it were just every now and again I would blame it on the server just dropping the ball every so often, but some users complain about having this problem consistently at the same exact spot, while others don't get it at all.

The part that bothers me the most is that no matter what I do I cant reproduce the issue that they are having. How can I diagnose this issue without being effected by it? I'm stumped.

Do you guys have any idea what might be going on, or anything that I can do to get more information on what might be happening? Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

独留℉清风醉 2024-10-25 05:50:12

听起来您的服务器脚本正在获取它不喜欢的数据,并在某些情况下崩溃(可能是字符串中的坏字符)。脚本终止并且请求没有返回任何内容。您可以尝试使用错误处理程序包装服务器脚本,该错误处理程序捕获并记录意外错误并向客户端返回状态代码,以便您知道发生了什么,而不是简单地切断连接。

如果它挂起,问题可能是代码中的无限循环,这将更难捕获。您可能需要以某种允许转储调试信息的方式引发和处理超时。

Sounds like your server script is getting data it doesn't like and crashing under certain circumstances (could be anything like bad characters in a string). The script dies and the request returns nothing. You could try wrapping your server script with an error handler that catches and logs unexpected errors and returns a status code to the client so you know what's going on rather than the connection simply being severed.

If it's hanging though the issue could be an infinite loop in the code which will be harder to catch. You may need to raise and handle timeouts in some way that allows for dumping debugging information.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文