I'm currently writing a client in ActionScript 3 that talks to a Red5 application/media server via a NetConnection object. The server sends the client multiple types of data over this connection including video, audio and remote procedure calls. After an indeterminate amount of time (sometimes 10 seconds, sometimes 10 minutes) I see the following error in a popup window from my Debug version of the Flash client:
"Error: Error #2030: End of file was encountered."
I'm in the process of trying to figure out what's causing this error and the thing that's really driving me nuts is that I can't seem to catch it. I realize that the error probably indicates some low-level network read failing, but the fact that it generates a popup window in the debug flash player implies that I should be able to catch it.
Since the error has no associated stack trace, I went so far as to add the an uncaught exception handler on my base Sprite object:
public class MyClient extends Sprite
{
public function FOWClient()
{
loaderInfo.uncaughtErrorEvents.addEventListener(UncaughtErrorEvent.UNCAUGHT_ERROR, uncaughtErrorHandler);
}
private function uncaughtErrorHandler(event:UncaughtErrorEvent):void
{
trace("UNCAUGHT EXCEPTION!!!");
}
}
My uncaught exception handler will get called properly if I purposely throw in some errors, but it never gets called when this Error #2030
happens.
So there are really two outcomes that would be acceptable to me:
I'm pretty sure I've narrowed it down to having to do with RPC calls being made from my server to my client because when I disable those, but leave audio & video, I don't see the issue. Unfortunately, I don't yet have any good ideas beyond that.
Any help is appreciated. Thanks!
Some of this errors are thrown if the proper listener is not added.
Are you listening for asyncError
and ioError
events from your netconnection?
If not, just give it a try.