Hi

I am new to Android network application develop, I am trying to set the
timeout with my HTTP request by using DefaultHttpClient.

Sometimes I found that the TimeOut parameter has no effect, and the program
will be blocking at the execute() method. Here is the outline of my code:

----------
HttpParams params = new BasicHttpParams();
HttpConnectionParams.setConnectionTimeout(params, TIMEOUT);
HttpConnectionParams.setSoTimeout(params, TIMEOUT);

HttpClient httpClient = new DefaultHttpClient(params);
HttpGet     httpGet = new HttpGet(url);
HttpResponse response;
response = httpClient.execute(httpGet);

.......

-------------

The platform is Android 1.6 .

I wonder if the above code cannot cover some network condition where the
TimeOut has no effect.  Could someone give me some hint how to write a
robust Timeout Code for this?  Or is there any "standard" example?   Any
suggestion is appreciated.

Thanks a lot in advance~

Best

Hugo

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to