2

I'm about to start using LocalConnections in a couple SWF's to let them talk to each other. But before I head down this road, I need to make sure it's not going to cause any popups and confirmation dialogs to appear from the system.

If I use a local socket server, that causes the Windows firewall and many others to flag it and require confirmation. So if LocalConnection uses sockets, then I can't use it.

But I've read via some web searching that it actually works using shared memory, which won't cause any firewalls to complain.

Can anyone who has used LocalConnection confirm or deny that it causes problems with the host OS? Particularly with Win7/Vista.

4

3 回答 3

2

我一直在使用LocalConnection(用于查看我的服务器托管 SWF 的跟踪消息),但从未见过任何弹出窗口。的liveDocs页面LocalConnection说:

在 ActionScript 3.0 中创建的 LocalConnection 对象可以与在 ActionScript 1.0 或 2.0 中创建的 LocalConnection 对象进行通信。反之亦然。Flash Player自动处理不同版本的LocalConnection 对象之间的这种通信。

所以我想可以安全地假设 Flash 播放器负责使用 LocalConnection 进行 swf 之间的通信,并且不会涉及任何弹出窗口。

于 2009-10-23T04:44:15.657 回答
1

I found this link, which proves that LocalConnections work with shared memory synchronized with a mutex.

But it's a little old (2007) and I'm currently working with the Flash 10 player using AS3.

于 2009-10-23T01:07:23.020 回答
1

我在具有相当广泛的 QA 测试的环境中使用了 LocalConnection。它有一些奇怪的地方,但总的来说,它似乎可以在各种平台上可靠地工作,而不会对用户产生影响。

奇怪的事情:我们遇到的一个问题是内存文件和互斥锁直到计算机上的所有闪存播放器实例都被关闭后才被释放。这是在 Flash 播放器实例之一死亡或被杀死并且没有释放 LocalConnection 的情况下出现的问题。可以传入 flashvars 的仲裁器告诉每个 SWF 在运行时使用哪个本地连接,这样您就可以每次都指定一个新的本地连接。当然,如果这种情况经常发生,它会通过填满内存来加剧问题......

另一个问题是(仅从观察来看——没有证据支持这一说法)互斥锁的实现可能有些幼稚。向单个本地连接添加过多的侦听器/发送器有点不可靠。我们通过简单地使用 LocalConnections 作为一种方式调度,一个发送者,一个接收者来避免这个问题。这个问题在这里得到了很好的描述

于 2009-11-06T19:12:55.117 回答