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

    XMLSocket.onConnect - success is false?

    sneakyimp Level 2
      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);

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

      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:
      <?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 -->
      <allow-access-from domain="*" />

      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.