2 Replies Latest reply on May 27, 2007 12:19 AM by sneakyimp

    XMLSocket.onConnect - success is false?

    sneakyimp
      I'm using Flash MX 2004 and i've written a sample socket server in php. it responds when i telnet in from everywhere:
      * using telnet from the Win XP command line from my desktop
      * using raw telnet from puTTY from my desktop
      * using telnet from the linux command line on the server

      flash, however won't let me connect with and XMLSocket. XMLSocket.connect returns true but my onConnect function always receives success=false. I CANNOT FIGURE OUT WHY. How do i figure out what the problem is?

      Here's my actionscript:
      var host:String = 'mydomain.com';
      var port:Number = 1234;

      mySock = new XMLSocket();
      mySock.onConnect = function(success) {
      trace('this is my anonymous onConnect function');
      trace(' success:' + success);
      mySock.send('foobar is what i sent');
      }
      trace('here we go, connecting to ' + host + ":" + port);
      var foo = mySock.connect(host, port);
      trace('connect attempted, foo is ' + foo);
      mySock.close();


      the trace results are this:
      ===trace===
      here we go, connecting to mydomain.com:1234
      connect attempted, foo is true
      this is my anonymous onConnect function
      success:false
      ===trace===

      How on earth do I figure out what this false results is for? I have put the following crossdomain.xml file at the root of mydomain.com:
      ===crossdomain.xml===
      <?xml version="1.0"?>
      <!DOCTYPE cross-domain-policy SYSTEM
      " http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
      <!-- Policy file for http://www.mysite.com -->
      <cross-domain-policy>
      <allow-access-from domain="*" />
      </cross-domain-policy>
      ===/crossdomain.xml===

      I have also tried uninstalling flash player 9 and installing he debug version instead. the trace statements end up in flashlog.txt but this directive is totally ignored apparently:
      SecurityDialogReportingEnable = true

      I never get any security message or anything. I'm totally mystified.