Hello,

On Tue, Feb 23, 2010 at 2:25 PM, Henrik Andersson <he...@henke37.cjb.net> wrote:
> Doing anything but copying the data from the event to your own bytearray
> buffer object is a disaster waiting to happen.
>
> TCP is a stream based protocol, you can get chunks of any length each time
> the event is reviced. Assume that the chunks are random length and piece
> them together in a buffer of your own. Then, once you know that you have a
> full logical unit, process the data.

I agree with you (from my Perl/C experience)
and will switch to using ByteArray:

_socket.readBytes(myByteArray, offset, _socket.bytesAvailable);

Or maybe I'll start using XMLSocket (is that one safe?)

The only thing I don't understand is why does ActionScript API
offer a function like readUTF() if it can't be used at all?

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

Reply via email to