为什么 Flash Media Server 不调用 application.onDisconnect 处理程序?
我在 Flex/Flashcom 应用程序中遇到了奇怪的问题。 如果客户端应用程序意外地与服务器断开连接,后者不会调用 application.onDisconnect 处理函数。 我应该朝女巫的方向看吗? 谢谢。
更新 我没有使用服务器组件,但我确实在 Linux 上托管了这个东西。
I've run into strange problem in my Flex/Flashcom application. If client application unexpectedly disconnects from server latter does not call application.onDisconnect handler function. In witch direction should I look? Thank you.
Update I'm not using server components, but I do host this thing on Linux.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果是这样,则会记录下来并 这里是一个值得关注的有趣论坛..基本上在 Linux 上它可能工作得有点疯狂:)
If so, it's documented and here an interesting forum to follow..basically on Linux it may work a bit crazy like :)
在(Flash Media-)服务器“知道”这一点之前,客户端可能会断开连接。 因此,直到非常非常晚才会调用“onDisconnect”函数(客户端永远不会调用它)。
如果您想尽早检测(并采取行动)“挥之不去”的断开连接,请使用 client.getStats() 方法。
我有一个服务器端动作脚本示例:
您可以通过从已连接的 Flash 客户端移除网络电缆来触发和测试此“缺少 onDisconnect”行为。
It's possible that a client is disconnected before the (Flash Media-) server 'knows' about this. So no 'onDisconnect' function gets invoked (it never gets called by the client) until very, very late.
If you want to detect (and act upon) "lingering" disconnects early, use the client.getStats() method.
I have this server-side actionscript example:
You can trigger and test this 'missing onDisconnect' behavior by removing the network cable from the connected Flash client.
正如Artem Tikhomirov(问题的作者)在他的自己的答案,我的答案没有帮助(我将其作为维基保留在下面,以供存档)。
关于Ric Tokyo给出了真正的答案questions/359727#486550">Linux 上的错误,并记录在 此线程。
我的答案被“选择”的唯一原因是因为 Artem 在 7 天限制之前没有选择任何其他答案(或他自己的答案),给了我(第一个也是最多投票的答案)一半的赏金分(超过 75 分) 150) 自动,如此博客条目中所述一个>。
第一条线索:
如果客户端是基于组件的应用程序,则需要[正确处理连接事件][9]。
然后,您可能需要检查 Flash 输出面板中的任何错误消息,例如:
这将指示客户端未考虑服务器异常,从而强制意外退出。
如果客户端从服务器读取流,则必须确保:
一个好的代码应该是这样的:
由于 FlashPlayer 的新版本确实会传播此类异常,因此它们必须被监控然后在客户端应用程序中捕获
As mentioned by Artem Tikhomirov (the author of the question) in his own answer, my answer is not helpful (I keep there below as wiki, for archive).
The real answer has been given by Ric Tokyo regarding a bug on Linux, and is documented in this thread.
The only reason my answer is "chosen" is because Artem did not choose any other answer (or an answer of his own) before the 7 day limits, giving me (the first and most upvoted answer) half of the bounty points (75 over 150) automatically as explained in this SO blog entry.
First lead:
If the client is a component-base application, it needs to [handle connection events properly][9].
Then, you may want to check any error message in the Flash output panel, like:
That would indicate a server exception non-taken into account by the client, forcing an unexpected exit.
If the client read a stream from the server, it must make sure:
A good code would like this:
Since the new versions of FlashPlayer do propagate those kind of exception, they must be monitored and then catch in the client application