10.21
We’ve been looking into some inconsistent behaviour across platforms when making socket connections. An application that works fine in Windows and OSX fails for no apparent reason when running on Linux platforms. After running a WireShark network capture, we established that, after correctly fetching a socket policy from port 843 of the remote host, the data sent to the target port was corrupted when using Linux Flash Player.
It turns out that the culprit is the Linux implementation of Socket.writeMultiByte, at least certainly when using the “us-ascii” encoding (it’s late and we can’t be bothered to test other encodings).
So, the line:
socket.writeMultiByte("GET somepath HTTP/1.0 \r\n","us-ascii");
fails completely, with garbage getting written to the socket.
We’ve written a naive (and appropriately named) replacement which works for what we’re doing, but doesn’t handle encodings.
private function writeBetterMultiByte2(msg:String):void
{
for(var i:int=0;i<msg.length;++i)
{
socket.writeByte(msg.charCodeAt(i));
}
}
It appears that we’re not the only ones having trouble with writeMultiByte, but this time it’s with ByteArray.writeMultiByte . Something seems quite broken here.
Yes, I am having the same issue on Linux for AlivePDF (AS3 PDF generation library) where writeMultiByte is failing. Will post here any update if I have some more infos.
There seem to be a few bugs related to this: see http://bugs.adobe.com/jira/browse/FP-1162 and http://bugs.adobe.com/jira/browse/FP-1345.
Issue appears to be resolved in the latest update to the Gecko engine.
Latest Firefox update corrects the problem in the international support library.
Working version reads:
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.7) Gecko/2009030423 Ubuntu/8.04 (hardy) Firefox/3.0.7
Using Shockwave Flash 10.0 d21 pure 64-bit.
Flash version 10 32-bit flash with Seamonkey (latest Mozilla derivative with integrated email) is also working now.
Normal Ubuntu updates will correct this issue.