--- In [email protected], "e_baggg" <[EMAIL PROTECTED]> wrote: > > ## Try adding a null byte before flushing the flash.net.Socket. > > Ted- > Thanks for your response but I am still unable to get it working. > Partly b/c I can't find any help on how to add a null byte. I would > think this (or '\0') would accomplish it but it does not. Sorry, > couldn't find any help online. > > //this is a connected flash.net.Socket > this.writeUTFBytes(xml.toXMLString() + null); > this.flush(); > > > --- In [email protected], "Ted Patrick" <tpatrick@> 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); > > } > > } > > >
Hi: Send me an email to [EMAIL PROTECTED] I have a whole game written using Flex2 Binary Sockets. Bunch of stuff you'll need. Cheers, Dave -- 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/

