New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sometimes Not send request to sever but called onFailure method #725
Comments
you should tell us which version you use,and which android-platform you use. |
Version 1.4.6 and android4.2.2 |
Well without further information, nobody will be able to help you. Closing this. |
thanks for your reply, I use AsyncHttpClient in a Singleton,in my project the client has only one and it is static ,when my app started I get a new instance of client then I do get or post use it.But sometimes it not send request(because fiddler no request had saw) and call onFailure,then I try send request again but it also call onFailure,three or four times then it works fine. |
What ExecutorService (ThreadPool) do you use? The default one? |
donot change ThreadPool |
Get and post here StackTrace of exception returned in onFailure method, or in LogCat, thanks |
OK,because it is comes sometimes I will try to reappear it and get these exception here.Thank you. |
I reappear it and get the exception,it is Time out exception,but not request had send and just call onFailure (I saw the fiddler not request send).Then try 2 or 3 times ,it is work, and the retry call onFailure also is Timed Out and time out quickly, like only one second.I set the time out use these code:
use android-async-http-1.4.5.jar the StackTrace is :
some other are :
|
Without digging through the library or any possible problems you're dealing with, you should know, that in case of request timeout, you should retry the request One additional question, do you use HTTPS(443) or HTTP(80) |
I reappear these time out many times ,it likes not normal request timeout because it is happen quickly,when I send request then I get time out and fiddler see no request had been send, no send by call onFailure and get the exception is timeout ,if it is the server-side error ,it may happens when request had send 30 seconds because I set
I use http not https.and these requests I send in fragment. |
As I said, if you suffer from the SocketTimeoutExceptions, you should handle them gracefully and eg. retry them. Does this happen to you on multiple devices and separate networks? I mean, have you tested it's not problem of your current development environment? Good you use http (unless you're sending some sensitive data over the non-encrypted channel), https suffers sometimes from this problem (i've seen it reported already) |
Thank you . I had do retry when I get SocketTimeoutExceptions. But the question is why there is not request had send and call onFailure method, any way can fix it ? Thanks again |
My net is Ok , call a request not do the request but call onFailure?
The text was updated successfully, but these errors were encountered: