I've been unsuccessful at finding an example of a functional AS app which uses one of the second two approaches, I can only find broad descriptions of what needs to happen.
It appears that Socket.bytesAvailable functions differently depending on the version of AIR, either representing the number of bytes which haven't yet been read or the cumulative total of bytes sent over the socket. If I have to do this without looking at functional examples, how would one transmit a terminator byte or byte size while using Socket.writeObject()? Perhaps the reason I can't find examples is it's not even a good idea to try? The problem I'm trying to solve is to transmit an instance of a class like this from the server app and reassemble it on the client: package mn.webershandwick.firebell.data { import fl.data.DataProvider; public class SiteVO extends Object { public var siteId:String; public var posts:Array; public var profilesDataProvider:DataProvider; public function SiteVO() {} } } Socket.writeObject and Socket.readObject does everything for me but fails consistently when the amount of data held in the variables is large and intermittently at any size over a wireless connection. On 2/15/12 11:41 AM, "Henrik Andersson" <he...@henke37.cjb.net> wrote: You need to separate data manually. You have three strategies: * Fixed size (easy, not flexible) * Terminator (slightly tricky with buffers, flexible, possible escaping issues, slight overhead) * Transmitted size (easy with buffers, flexible, slight overhead) _ _ _ Erik Mattheis | Weber Shandwick P: (952) 346.6610 M: (612) 377.2272 _______________________________________________ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders