flash.net.Socket sending but never receiving data
Ok,
I'm trying to make a barebones, simple flash client communicate ANYTHING to a server over a regular socket.
I setup the listeners:
socket = new Socket();
socket.addEventListener(Event.CLOSE, closed);
socket.addEventListener (DataEvent.DATA, onSocketData);
socket.addEventListener(Event.CONNECT, connected);
socket.addEventListener( ProgressEvent.SOCKET_DATA, onSocketData );
socket.addEventListener(ProgressEvent.PROGRESS, progressHandler);
socket.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
socket.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
And then I connect. On the server side I have a simple policy server on port 843. And then the real socket server that the flash client is connecting to.
Here's the deal. The flash client connects to the policy server and gets the policy. The flash client then connects to the actual socket server. I know this because I can both see it when snooping the network traffic and the fact that the Event.CONNECT fires off. From snooping the network traffic I can see the flash client send data TO the server when it:
socket.writeUTFBytes( "TEST CLIENT\n");
From the server app I can see the data the client sent. The server then returns a little data. I can see this data going from the server to the client in the network traffic snooper. However, the client NEVER sees the data. It never fires off DataEvent.DATA or ProgressEvent.PROGRESS or ProgressEvent.SOCKET_DATA. There are no errors and the connection remains open for as long as I want it... but the flash client never seems to see the data... no matter how much I send.
Over and over I read online that the data sent to the flash socket needs to be terminated with a \0 zero byte. I can verify it is in the network traffic snoop.
Anyone experienced with recent socket development know of any reasons why the client would get the data (which I know it is from the network traffic) but that the class would never fire off any events that it does?
Also, if I try to read any data from the flash app via something like readUTFBytes it always returns nothing found.
I want to die right now. Can someone enlighten me?