Wednesday, June 20, 2012

[Action Script] Why wouldn't this be working? [Sockets] June,2012

[SWF] NewHost.swf - 3060 bytes after decompression
Binding to port 1.
Listening.
Handing connection from 75.176.54.201
Error: Error #2030: End of file was encountered.
at flash.net::Socket/readUTF()
at NewHost/captureSocketData()[I:\Aero9\src\NewHost.as:48]
Wrote


On my server end, I have a server socket binded to port 1. On connection, it waits for socket data to arrive.

When captureSocketData is tiggered
ActionScript Code: private function captureSocketData(e:ProgressEvent):void        {            socketData = socketData + e.target.readUTF();            trace("Retrieved " + socketData + " so far.");        }
the output log does throws and end of file error.


On the client end, the function to submit looks like this
ActionScript Code: function submitToSocket(e:Event):void{    status_txt.text = "Submitting content..";    postSocket.writeUTF(input_txt.text);    postSocket.flush();    postSocket.close();        urll.load(urlrq);}
Both use readUTF and writeUTF and both say in livedocs that they provide the length of the string before providing the string's data. What's going wrong? Is it just not sending it for some reason? It's a really simple script.


Here's the newhost script

Here's the client's script
Why wouldn't this be working? [Sockets]

Related Post



0 comments: