8 Replies Latest reply on Aug 25, 2009 2:08 AM by sentromed

    Security sandbox violation with localTrusted sandbox.

    sentromed

      Hi experts!
      I am Windows developer and recently I installed flash player 10.

      I am testing Socket class with localTrusted sandbox.

       

      I am connection to the server that is not respond. When I get IO_ERROR, I remove listener and the reference to the Socket. In some socket timout, I get the following error:

       

      Error #2044: Unhandled securityError:. text=Error #2048: Security sandbox violation: test.swf cannot load data from 93.84.217.161:0.

       

      It is not clear for me at all, why removing listener and reference to the socket, flex core (socket core, socket lib, do not know how to name), having reference to the socket, wants to call SECURITY_ERROR handler.

       

      Here is my simple code. Test not fails, but in about 10 seconds I get the error.

       

      public class SocketTest extends TestCase
      {
              private var sock:Socket;
              private function ioErrorHandler(event:Event):void
              {
                      sock.removeEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
                      sock = null;
              }
              public function testRequestHomePage():void
              {
                      Alert.show(Security.sandboxType);
                      sock = new Socket();
                      sock.addEventListener(IOErrorEvent.IO_ERROR, addAsync (ioErrorHandler, 2000),false,0,true);
                  sock.connect('93.84.217.161', 0);
              }

       

      }

       

      PS. It does not metter I use week or strong reference. I will get the same error if I remove ',false,0,true' in addEventListener.
      Thanks