PDA

View Full Version : xml sockets


stathis30_2000
09-03-2006, 09:33 AM
Hi all !

I read a previous post about xml sockets and laszlo. I am dealing with a strange problem. I am sending through the socket, data to my app. The problem is that data don't arrive using one ondata event but multiple events. Is there a buffer for the ondata event where data are stored ? Can I change the size of the buffer ?

My code is :

mySock = new XMLSocket();
mySock.connect("localhost",8383);

mySock.onData = handleData ;


Please help !
I have to fix this as soon as possible !

Geoff2010
09-06-2006, 09:47 AM
I use the XmlSocket object extensively in my OL application, and have never had a problem with it.

The Flash XmlSocket object natively uses a (byte)0 delimiter to seperate messages.

You could be running into problems if your server application is sending data back that has (byte)0 somewhere in the middle of the transmission.

If you are sure there is no (byte)0 in the middle of your transmission then I would need some more information on the server that you are communicating with before I could be of any more use.

-Geoff

stathis30_2000
09-06-2006, 01:20 PM
You are right!

My server had the '\0' between the data ! I didn't know that the function xmlSocket.send(data) appends the character '\0' at the end of data. My server which construct a string using incoming strings from the xml socket included the '\0' character. I thought of that so I used the function String.replace of java. For some reason it didnt't work...


Thanks for the help !
ST