0 Replies Latest reply on May 31, 2010 7:07 AM by SOMEONEINTHEWORLD

    flex socket

    SOMEONEINTHEWORLD Level 1

      Hello,

       

      I am implementing sockets through flex 4.  The server is sending 5000 bytes of data.  But i am not fully receiving it everytime i connect.  Sometimes half of total bytes and some times not even half of total bytes.

       

       

      This is the function i am using to get the data.

       

      protected function onProgressEvent(event:ProgressEvent):void
      {
           while(socket.bytesAvailable)

           {

                var allBytes:String = socket.readUTFBytes(socket.bytesAvailable);

           }

      }

       

      Can someone tell me how to get full data.

       

      Thanks