I work on a projet to send large amount of data with sockets. Files are splited into bytearrays of 1 to 8 mb (to be able to resume an upload) and send with HTTP protocol.
I think my project is correctly configured. A Flex 4.5.1 SDK updated with AIR 3, the flashplayer.swc 11 and compile with -swf-version=13.
The new JSON feature work fine. A have an issue with the Socket.
here is the code
socket.addEventListener(Event.CONNECT, connectHandler); socket.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler); socket.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler); socket.addEventListener(ProgressEvent.SOCKET_DATA, socketDataHandler); socket.addEventListener(OutputProgressEvent.OUTPUT_PROGRESS, outputProgressHandler); socket.connect(host,80);
and in the connectHandler
socket.writeUTFBytes(requetsHeader); socket.writeUTFBytes("\n"); socket.writeBytes(bytes); socket.writeUTFBytes("\n"); socket.flush();
I tried everything but the event OutputProgressEvent.OUTPUT_PROGRESS is never fired and bytesPending is always to 0.
I'm on Windows 7 64 bits.
thank you for your help.
I've been trying to do a similar thing myself. This is a big problem on Windows XP as the buffer becomes blocked. This was meant to be implemented in AIR 3.