What are default values for connection and socket timeouts in DefaultHttpClient on Android? What are default values for connection and socket timeouts in DefaultHttpClient on Android? android android

What are default values for connection and socket timeouts in DefaultHttpClient on Android?


Just try below below code section:

import android.net.http.AndroidHttpClient;...        AndroidHttpClient h = AndroidHttpClient.newInstance("My http client");        // ...        Log.d(TAG, "http.socket.timeout: " + h.getParams().getParameter("http.socket.timeout"));        Log.d(TAG, "http.connection.timeout: " + h.getParams().getParameter("http.connection.timeout"));

It works on my device:

12-02 16:27:54.119 D/Exam(17121): http.socket.timeout: 6000012-02 16:27:54.119 D/Exam(17121): http.connection.timeout: 60000


Wouldn't you be able to get the default (or whatever values are set) using something like the following:

DefaultHttpClient h;// ...Log.d(TAG, "http.socket.timeout: " +      h.getParams().getParameter("http.socket.timeout"));Log.d(TAG, "http.connection.timeout: "      + h.getParams().getParameter("http.connection.timeout"));

It's worth a shot if you really want to know what the default values are (as opposed to just setting the values yourself).