Note that the http-header "Connection: close" is merely a hint.
Well-behaved servers indeed do close the connection after all is set
and done, but they may as well choose to keep the connection open.

On Jan 21, 1:28 am, sjia <jiazheng...@gmail.com> wrote:
> Hi,
>
> I intend to stop a http connection once it times out. Here is my code.
> It seems that the setting is not working. Any comments?
>
> -------------------------------------
> HttpURLConnection conn = (HttpURLConnection) url.openConnection();
> conn.setRequestProperty("Connection", "close");
> conn.setConnectTimeout(1000 * 10 * 60);  // timeout after 10 minutes
> -------------------------------------
>
> Thanks

--~--~---------~--~----~------------~-------~--~----~
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