public function Main():void
var request:URLRequest = new URLRequest( "http://127.0.0.1:8080/myapp/info" );
request.data = new ByteArray();
for ( j = 0 ; j < 1000 ; ++j )
L2: var loader:URLLoader = new URLLoader();
var tsPkt:ByteArray = new ByteArray();
for ( i = 0 ; i < 188 ; ++i )
tsPkt.writeByte( 0xff );
request.data.writeBytes( tsPkt , 0 , tsPkt.length );
loader.dataFormat = URLLoaderDataFormat.TEXT;
request.method = URLRequestMethod.POST;
loader.load( request );
I set a counter to count the packets I received from this POST method.
I have two questions about above code segment.
1. When I move the statement from L2 to L1, the counter is just 1 instead of 1000, why?
2. When I change the j's upper to 2000, some packets will be lost, the upper bigger, the lost packets more, what is the root cause?
I tried many times, the result is disappoint, help!
Thanks to you guys.
I think you want URLDataFormat.BINARY or else you may have to Base64 encode.
Thanks to Flex harUI, I tried BINARY first, the overcome is the same.