Hello,

I have multiplayer game, which reads XML data from the server:

  _socket = new Socket();
  _socket.addEventListener(ProgressEvent.SOCKET_DATA, handleTcpData);
.....
private function handleTcpData(event:Event):void {
   while (_socket.bytesAvailable) {
      var str:String = _socket.readUTF();
      updateGUI(str);
   }
}

In most cases it works ok, but sometimes users complain that
the game hangs for them. They are able to send in commands to
the server, but from their descriptions I suspect, that the function
above doesn't work well for them and the updateGUI() stops being called.

This issue is difficult to debug... I think my server (in Perl/C,
non-forking, uses poll()) works well, I must be doing something
wrong at the Flash side.

Is it a good idea to call readUTF() here? It could well be that
only part of the UTF string arrives and then the Flash movie
would freeze in readUTF(), wouldn't it? (I've never seen that though)

Regards
Alex
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to