0 Replies Latest reply on Nov 30, 2007 3:34 AM by Alex22fr

    XMLsocket + localhost + FlashLite 2.1

    Alex22fr
      Hi,

      On FlashLite2.1, trivial XMLSocket code connecting to a localhost
      server fails in a strange manner:

      - The server sees the connection as established
      - But the onConnect callback never gets called

      This happens only on the device (a WM5 Samsung i860 smartphone). Not
      in Device Central.
      This does not happen if the server is more "remote" (over USB or
      GPRS).
      I suspect an issue with the speed of establishment of the socket, a
      kind of race condition in the implementation of XMLsocket.connect().

      The code, in the Actions of a single frame swf, is:

      var sok:XMLSocket;

      // do_connect is bound to a button press event
      function do_connect()
      {
      sok=new XMLSocket();
      sok.onConnect=function(){ /* set some dynamic text
      variable */}
      if (sok.connect("127.0.0.1",4444)) { /* do some other
      visible effect */}
      }

      In the emulator it works like a charm. On the device, sok.connect()
      return true but the visible effect of onConnect (setting some dynamic
      text in the frame) never occurs !

      Any idea ?

      -Alex