Skip to content Skip to sidebar Skip to footer

Connection Pooling With Urlconnection?

I've just read the android article about http client options. I'd like to start using HttpsURLConnection, how does one enable connection pooling for it? The article says that is po

Solution 1:

It's enabled by default. See the docs for some details:

http://developer.android.com/reference/java/net/HttpURLConnection.html

Solution 2:

It seems they disabled pooling by setting http.keepAlive=false, which brings System.setProperty("http.keepAlive", "true"); should enable pooling. But I don't think this is better approach unless you have same data.

Post a Comment for "Connection Pooling With Urlconnection?"