How can I catch and / or solve the problem with error # 2030: "End of file was detected" in NetConnection in ActionScript 3?

I am currently writing a client in ActionScript 3 that talks to a RedBox server / media server through a NetConnection object. The server sends the client several types of data over this connection, including video, audio, and remote procedure calls. After an indefinite period of time (sometimes 10 seconds, sometimes 10 minutes), I see the following error in the pop-up window of my version of the Debug Flash client:

"Error: Error #2030: End of file was encountered." 

I am trying to figure out what causes this error, and what really turns me nuts is that I cannot catch it. I understand that the error probably indicates a reading failure in low-level network reading, but the fact that it generates a pop-up in a debug flash player implies that I have to catch it.

Since the error does not have a related stack trace, I went so far as to add an uncaught exception handler on my Sprite base 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 exception handler will be called correctly if I intentionally throw some errors, but it is never called when this Error #2030 occurs.

So, there are really two results that would be acceptable to me:

  • How the hell can I catch this "End of File Error" error and handle it in code?
  • If I can’t catch it, are there any thoughts about what causes it, and how do I fix it?

I am sure that I narrowed it down to the point that I had to make RPC calls from my server to my client, because when I disconnected them, but left audio and video, I did not see a problem. Unfortunately, I have no good ideas yet.

Any help is appreciated. Thanks!

+4
source share
2 answers

Some of these errors are generated if the correct listener is not added.

Are you asyncError and ioError from your netconnection?

If not, just try it.

+2
source
 try { } catch( e : EOFError ) { trace( e ); // EOFError: Error #2030: End of file was encountered. } 
0
source

Source: https://habr.com/ru/post/1345961/


All Articles