Httpservice timeout with 2032 stream error - actionscript-3

I have a flash web application and I use HttpService to upload files to the server. It works perfectly fine for small-sized files(~11 MB), it however throws 2032 stream error when size increases beyond that. I tried increasing the requestTimeout param for Httpservice, but it does not seem to be working. It throws the Faultevent exactly after 60 seconds.
I have changed the PHP config settings to the max values. The upload to the server also fails.
I saw many links - eg : Flex HTTPService times out anyway but none of them is helping much.
I am using Flex 4.6 and AIR 15.0.0.356
Can anybody help me out?
Thanks in advance!

Related

Spring RestTemplate with JDK11 errors Posting data above certain limit

I am using OAuth2RestTemplate with JDK11 to make a POST request with Json data (860 lines and 26 KB). Strangely the code works fine with < 700 Json lines (or 20 KB) on production server and with < 500 lines (15 KB) on local machine. But as soon I increase few more data blocks in the JSON it start giving exception.
Exception is based on the HttpRequestFactory implementation used with RestTemplate.
In case I use HttpComponentsClientHttpRequestFactory then it is NoHttpResponseException XXX.XXX:443 failed to respond and if I use SimpleClientHttpRequestFactory then java.net.SocketException Unexpected end of file from server
restTemplate.postForEntity(Url, dataBytes, byte[].class);
Strangely this works with lower versions of JDK 8, 9 and 10. Also I have tried other Http client like Spring Webclient with JDK11 and same data works with it. Apart from that same data also works with Curl/Postman.
But not able to identify why it is creating issue with RestTemplate beyond certain data limit.
Below are some of the main dependencies I am using (Dependency wise can't change much in existing project).
Spring-core 5.1.6.RELEASE
org.apache.httpcomponents.httpclient 4.5.6
spring-security-core 5.1.4.RELEASE
spring-security-oauth2-client 5.1.4.RELEASE
JDK11
Any help or idea will be much appreciated. TIA
I have had the same issue with the following JDK11 versions:
IMPLEMENTOR="AdoptOpenJDK"
IMPLEMENTOR_VERSION="AdoptOpenJDK"
JAVA_VERSION="11.0.2"
IMPLEMENTOR="AdoptOpenJDK"
IMPLEMENTOR_VERSION="AdoptOpenJDK"
JAVA_VERSION="11.0.4"
but the issue no longer appears in 11.0.9.11. I have not yet found what the fix was

GoogleWebAuthorizationBroker sometimes crashes the app

I have a Windows Phone 8.1 app with Google login, which uses the
GoogleWebAuthorizationBroker.AuthorizeAsync
method. 90 % of the time, the authentication works, however, occasionally, the app just crashes on this line (I am logging right before it, so I am sure). I have the call wrapped inside try - catch, but that doesn't seem to work - exception is never caught.
I am also sure I am calling the method on a UI thread, I am using the DispatcherHelper from MVVMLight for that.
The fact that I am not able to reproduce the crash complicates this a lot, I have not experienced it with debugger attached, only in Release mode, on target device, run locally.
Do you guys have any ideas / clues / pointers? I know I'm not providing a lot of information, but I don't have any..
EDIT> So the error now happened with debugger attached - and the app just froze, last message in Ouput window was
"WinRT information: Cannot get credential from Vault"
But that's normal behavior..

Captured audio buffers are all silent on Windows Phone 8

I'm trying to capture audio using WASAPI. My code is largely based on the ChatterBox VoIP sample app. I'm getting audio buffers, but they are all silent (flagged AUDCLNT_BUFFERFLAGS_SILENT).
I'm using Visual Studio Express 2012 for Windows Phone. Running on the emulator.
I had the exact same problem and managed to reproduce it in the ChatterBox sample app if I set Visual Studio to native debugging and at any point stepped through the code.
Also, closing the App without going through the "Stop" procedure and stopping the AudioClient will require you to restart the emulator/device before being able to capture audio data again.
It nearly drove me nuts before I figured out the before mentioned problems but I finally got it working.
So..
1. Be sure to NOT do native debugging
2. Always call IAudioClient->Stop(); before terminating the App.
3. Make sure you pass the correct parameters to IAudioClient->Initialize();
I've included a piece of code that works 100% of the time for me. I've left out error checking for clarity..
LPCWSTR pwstrDefaultCaptureDeviceId =
GetDefaultAudioCaptureId(AudioDeviceRole::Communications);
HRESULT hr = ActivateAudioInterface(pwstrDefaultCaptureDeviceId,
__uuidof(IAudioClient2), (void**)&m_pAudioClient);
hr = m_pAudioClient->GetMixFormat(&m_pwfx);
m_frameSizeInBytes = (m_pwfx->wBitsPerSample / 8) * m_pwfx->nChannels;
hr = m_pAudioClient->Initialize(AUDCLNT_SHAREMODE_SHARED,
AUDCLNT_STREAMFLAGS_NOPERSIST | AUDCLNT_STREAMFLAGS_EVENTCALLBACK,
latency * 10000, 0, m_pwfx, NULL);
hr = m_pAudioClient->SetEventHandle(m_hCaptureEvent);
hr = m_pAudioClient->GetService(__uuidof(IAudioCaptureClient),
(void**)&m_pCaptureClient);
And that's it.. Before calling this code I've started a worker thread that will listen to m_hCaptureEvent and call IAudioCaptureClient->GetBuffer(); whenever the capture event is triggered.
Of course using Microsoft.XNA.Audio.Microphone works fine to, but it's not always an option to reference the XNA framework.. :)
It was a really annoying problem which waste about 2 complete days of mine.My problem was solved by setting AudioClientProperties.eCatagory to AudioCategory_Communications instead of AudioCategory_Other.
After this long try and error period I am not sure that the problem won't repeat in the future because the API doesn't act very stable and every run may return a different result.
Edit:Yeah my guess was true.Restarting the wp emulator makes the buffer silent again.But changing the AudioClientProperties.eCatagory back to AudioCategory_Other again solve it.I still don't know what is wrong with it and what is the final solution.
Again I encounter the same problem and this time commenting (removing) the
properties.eCategory = AudioCategory_Communications;
solve the problem.
I can add my piece of advice for Windows Phone 8.1.
I made the following experiment.
Open capture device. Buffers are not silent.
Open render device with AudioDeviceRole::Communications. Buffers immediately go silent.
Close render device. Buffers are not silent.
Then I opened capture device with AudioDeviceRole::Communications and capture device works fine all the time.
For Windows 10 capture device works all the time, no matter if you open it with AudioDeviceRole::Communications or not.
I've had the same problem. It seems like you can either use only AudioCategory_Other or create an instance of VoipPhoneCall and use only AudioCategory_Communications.
So the solution in my case was to use AudioCategory_Communications and create an outgoing VoipPhoneCall. You should implement the background agents as in Chatterbox VoIP sample app for the VoipCallCoordinator to work .

IOError 2032 happens sometimes

My application loads 60 files at the same time. I mean I create 60 loaders (in an array) and start all loadings in a loop, I don't wait for one to complete before I start the next.
I use a class that extends URLLoader to load xml, bin, png, mp3 and swf.
I log when users get a IOErrorEvent, and I see error 2032 happen sometimes, not always with the same file, and when I try again, the loading completes.
Do you know why I could have a random 2032 error with URLLoader ?
Edit : Is URLLoader appropriate to load many files at a time ? Should I better have an open connection, request all the files, then close the connection ?
It could be because of improper handling of Loader Events and data associated with it.
You can try using:
BulkLoader Class by Arthur Debert
they have done some reliable work in this regard.

Fault NetConnection Failed using actionscript RemoteObject lots of datas

I have an air (4.5.1) mobile project that send an ArrayCollection to the server (Tomcat/BlazeDS)
The server manage the object and return a string containing the result (ok/error/etc)..
Everything worked fine, until:
I tried to send an ArrayCollection with length > 35000 (not sure border limit).
After sending the arraycollection the UI seems like frozen for a little time, and after that
I got a FaultEvent Error
NetConnection.Call.Failed: HTTP: Failed
The server however received the request, parsed it and returned the result string
So, because the program get the faultevent, I cannot be sure (from the client) that the request is finished correctly...
How can I fix it? and is this problem generated by the length of the arraycollection?
Other ideas?
Thanks
This is an on going issue with Flex/Air/Flash. The problem you are running into is a defualt value for requestTimeout of 30 seconds. Even if you change the value in your remoteObject, it is not getting used correctly. There are MANY MANY documented bugs on adobe regarding this issue. Below is a link to a site that has collected some info about this problem from around the web. To date adobe has yet to fix the problem even though that claim they have in previous versions.
RemoteObject Issue