Hey guys, I'm having an odd problem with the LocalConnection class. Short version: My LocalConnection code runs perfectly until it doesn't. Long version: I'm launching a game on Steam/Windows soon, and I'm using an AIR 21 application to load a .swf file using HTMLloader, which runs in a captive Flashplayer (correct me if I'm wrong, but I don't think the newer versions of AIR allow a captive Flashplayer? The end user must NOT be required to have the Flash plugin). I'm running the game this way so I can use AIR's application features like file-creation and ANEs, while still having access to the deprecated Stage-quality settings of Flashplayer. I'm basically porting a browser-game with vector-graphics to Steam. I've set up a seperate LocalConnection in each direction, from the AIR .swf to the Flashplayer .swf, and vice versa (both using AS3), and I use them to transfer save files both ways, and to unlock achievements on Steam. When the game starts, this works perfectly, for anywhere between a few minutes to several hours (the connection is used regularly). Then attempts to send data from the Flashplayer side just stop working, and any attempts to close and re-create the connection on that side are unsuccessful, until the game is restarted. From what I understand, the status error message is the same as if the receiver did not exist. But the AIR .swf (the receiver) is very basic, it just loads Flashplayer and waits for commands through LocalConnection - I don't see what could have happened to it. As far as I can tell I've done everything mentioned in Adobe's documentation - and my LocalConnection code is the same as the examples given. I've limited the domains to "localhost" and "appname", I've made sure the data I'm sending is less than 40kb, and I've got listeners that display errors if data fails to send. I have no idea what I've done wrong. Everything works correctly at first. Is there any other LocalConnection limitations I'm not aware of? What could cause a LocalConnection to close unexpectedly? Could other running applications possibly interfere? What is the best practice for programming a fail-safe? Can anyone confirm they've used LocalConnection in a similar way without any problems, and therefor there's a problem with my code somewhere else? I've heard it's possible for LocalConnections to break if the application crashes and the connection stays open until a system restart. But I don't think that applies here, since my app doesn't need to crash, and a system restart is not required - only my app needs to be restarted for the connection to work again. Thanks, and sorry for the long post.
... View more