So adding a null byte like so didn't work either. Wish XMLSocket was open source so I wouldn't have to ping the forum! :P
//doesn't work. 'this' is a flash.net.Socket var bytes:ByteArray = new ByteArray(); bytes.writeUTFBytes(xml.toXMLString() + '\0' ); this.writeBytes(bytes); this.flush(); --- In [email protected], "Ted Patrick" <[EMAIL PROTECTED]> wrote: > > There is no default delimiter in flash.net.Socket. XMLSocket uses a null > byte delimiter to detect message completions to fire the 'data' and > 'xml' events. If you are using an XMLSocket Server supporting null > bytes. Try adding a null byte before flushing the flash.net.Socket. > > > > That should work seamlessly. > > > > Also on the receiving side, you will need to read bytesAvailable into a > buffer to detect the null byte to denote a message received. > > > > Ted :-) > > ________________________________ > > From: [email protected] [mailto:[EMAIL PROTECTED] On > Behalf Of e_baggg > Sent: Thursday, October 19, 2006 8:44 AM > To: [email protected] > Subject: [flexcoders] Socket woes - something simple I'm sure > > > > Hello. I have a XMLSocket class that I am able to send/receive data to > no problem. > > I switched my implementation to use the flash.net.Socket class and now > I cannot receive data back. > > I updated my sendMessage() to the following...this request should > trigger a response from the server but it doesn't...most likely b/c my > request is incorrect. What does the XMLSocket do for me that I am not > doing here? I thought maybe adding the "\n" to the String would work > but it did not. The sendMessage() method is called in my > connectHandler so I know the socket is connected. There are no errors > in my IO and security handlers. > > import flash.net.Socket; > public class MySocket extends Socket > { > ... > public function sendMessage(xml : XML) : void > { > try > { > var ss : String = xml.toXMLString(); > //ss = <credentials user="me" password="pass"/> > this.writeUTF(ss); > this.flush(); > trace("Send-->:" + ss); > } catch (error : IOError){ > trace("Error: " + error.message); > } > } > -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/flexcoders/join (Yahoo! ID required) <*> To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/

