2 Replies Latest reply on Mar 25, 2008 11:34 AM by jylaxx

    data Bursts: Are socket data overwritten??

    michalis0
      Hi, i am using a binary socket to read some (text) data.
      When I sent only a few data everything seems ok.
      When I sent bursts of data, I seem to be losing the top part of the my data.
      Is that possible?

      I am attaching some of code I am using (adapted from the Telnet client of adobe source).
      Is the data burst the problem, or am I not reading it correctly?

      thanks

      ------------------------------------------------------------------
      socket = new Socket();
      socket.connect(serverURL, portNumber);
      socket.addEventListener(ProgressEvent.SOCKET_DATA, dataHandler);

      private function dataHandler(event:ProgressEvent):void {

      var n:int = socket.bytesAvailable;
      var bArray:ByteArray = new ByteArray();
      socket.readBytes(bArray, 0, n);

      etc...