0 Replies Latest reply on Nov 20, 2009 8:14 AM by Lesto

    ServerSocket  -Error #2004 but only after install air app in win XP

    Lesto

      OOPS wrong section, posted also in Adobe AIR2....sorry

       

      When i try to connect i receive: Error #2004 after bind().

      but only when start the installed air on win XP,

      testing in flash CS4 is ok and on macOS 10.6 is always ok

       

      here' the code:

       

      //------------------------------------------------------------------------

      import flash.net.*;
      import flash.net.ServerSocket;
      import flash.events.ServerSocketConnectEvent;
      import flash.errors.*;

       

      var servSok:ServerSocket = new ServerSocket();
      servSok.addEventListener(Event.CONNECT, connect);

       

      var msg:TextField = new TextField();
      msg.height=300;
      msg.width=300;
      msg.x=50;
      msg.y=50;
      this.addChild(msg);
      msg.appendText("------MSG--------\n");
      function connetti(e:Event):void {
          try {
              var port:int = int(8888);
              var address:String = "0.0.0.0";
              this.servSok.bind(int(port),String(address));
          } catch (e:Error) {
              this.msg.appendText("errore bind:"+e.message+"\n");
          }
          try {
              this.servSok.listen(5);
          } catch (e:Error) {
              this.msg.appendText("errore listen:"+e.message+"\n");
              trace("errore listen:"+e.message);
          }
      }
      function connect(e:ServerSocketConnectEvent):void {
          msg.appendText("connesso:"+e+"\n");
      }

      //----conn is a button....
      this.conn.addEventListener(MouseEvent.CLICK,connetti);
      stop();

      //---------------------------------------------------------------------------------

       

      Can anyone may help me?