Tuesday, January 29, 2008

Can someone please explain to me why Flash requires a zero byte terminator?

I ran into this years ago when adding network TCP/IP stream support for 3rd party clients and one of the companies wanted to use Flash to consume our AI and I couldn't understand why the damn thing couldn't receive responses (they were using XMLSocket in Actionscript) and there was zero information at the time because this was a new 'feature' of Flash. I only figured it out (luckily) when I noticed that n batched commands to the AI resulted in n-1 responses showing up in Flash. I figured we were missing a terminator. Why flash wouldn't need a terminator on multiple submissions but need one on a single submission is beyond me, anyhow, anybody out there understand the reasoning behind this? I'm consolidating some networking code and I really would like to eliminate this 'special case' in some fashion as I have two socket::send methods, one for normal properly behaving (imho) clients and one for flash that adds an extra zero byte explicitly into the TCP/IP stream. *** End Rant ***

No comments:

Post a Comment