I’m sen to server socket an Array from swf, (using writeObject) and server resend to all clients (its not any process on bytes). But at swf side I’m not read this array. What can i do to solve this problem.
My Codes:
fl_socket.addEventListener(ProgressEvent.SOCKET_DATA, veri_geldi);
function veri_geldi(e:ProgressEvent):void
{
if (fl_socket.bytesAvailable > 0)
{
GELEN_VERI = fl_socket.readUTFBytes(fl_socket.bytesAvailable);
veri_tipi = GELEN_VERI.split(';');
switch (veri_tipi[0])
{
case "DURUM_BILGISI" :
durum_bilgisi.text = GELEN_VERI;
break;
//Other Cases
default :
//it's not work after this line...
GELEN_BYTES = e.target.data; // "GELEN_BYTES" as a ByteArray
Dsteps2 = GELEN_BYTES.readObject(); // Dsteps2 as an Array
durum_bilgisi.text = Dsteps2[0].toString() + "|" + Dsteps2[1].toString();
break;
}
}
}
e.target.data is not a ByteArray but Socket and You read all received bytes at line :
Do not expect any data in line :
… because You already read last aviable data .