Just to take a guess: DNS ? What happens if you use the IP address in the url, rather than server name?
-- Kostya 16.11.2010 18:31, SImplyG2010 пишет:
Good morning everyone, I am having a hugely annoying issue with delays using HTTPClient and post the first time I call execute on the client the response takes 5 seconds to come back. Subsequent calls take around 100 to 200 ms. I am using the Apache client so does anyone know why this takes so long? The client setup looks like below HttpParams params2 = new BasicHttpParams(); params2.setParameter(CoreProtocolPNames.PROTOCOL_VERSION, HttpVersion.HTTP_1_1); params2.setParameter(CoreConnectionPNames.TCP_NODELAY, true); params2.setParameter(CoreProtocolPNames.HTTP_CONTENT_CHARSET, HTTP.UTF_8); params2.setParameter(CoreProtocolPNames.USER_AGENT, "Apache-HttpClient/ Android"); params2.setParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, 15000); params2.setParameter(CoreConnectionPNames.STALE_CONNECTION_CHECK, false); HttpClient client = new DefaultHttpClient(params2); // params are a bunch of post params about 5 of them. HttpPost post = new HttpPost(baseURL); post.setEntity(getPostContent(params)); client.execute(post); The timing for this look like below. 11-16 08:10:50.709: VERBOSE/SG Log verb(332): Call complete 5753 11-16 08:10:50.979: VERBOSE/SG Log verb(332): Call complete 271 11-16 08:10:51.099: VERBOSE/SG Log verb(332): Call complete 114 11-16 08:10:51.319: VERBOSE/SG Log verb(332): Call complete 221 11-16 08:10:51.419: VERBOSE/SG Log verb(332): Call complete 97 11-16 08:10:51.579: VERBOSE/SG Log verb(332): Call complete 165 11-16 08:10:51.689: VERBOSE/SG Log verb(332): Call complete 106 11-16 08:10:51.849: VERBOSE/SG Log verb(332): Call complete 161 Any help is much appreciated!
-- Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com -- 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