0 Replies Latest reply on May 9, 2010 11:34 PM by orzFlex

    why can't establish a socket connection?

    orzFlex Level 1

      As said in Adobe document :

       

       

      When policy files were first introduced in Flash Player 6, there was no  support for socket policy files. Connections to socket servers were authorized  by a policy file from the default location of the cross-domain policy file on an  HTTP server on port 80 of the same host as the socket server. To make it  possible to preserve existing server arrangements, Flash Player 9 still supports  this capability. However, Flash Player's default is now to retrieve a socket  policy file on the same port as the socket connection. If you wish to use an  HTTP-based policy file to authorize a socket connection, you must explicitly  request the HTTP policy file using code such as the following:

      Security.loadPolicyFile("http://socketServerHost.com/crossdomain.xml")

      Then ,why can't I establish a socket connect using the following code


                     Security.loadPolicyFile("http://192.168.25.130:80/crossdomain.xml");
                      var socket:Socket=new Socket();
                      socket=new Socket();
                      socket.addEventListener(Event.CONNECT,handler);
                      socket.addEventListener(IOErrorEvent.IO_ERROR,handler);
                      socket.addEventListener(ProgressEvent.SOCKET_DATA,handler);
                      socket.addEventListener(SecurityErrorEvent.SECURITY_ERROR, handler);
                      socket.addEventListener(Event.CLOSE, handler);
                      socket.connect("192.168.25.130",12345);

       

      I can access the crossdomain.xml through brower.