Hi,
I have a problem where the socket times out before the value which was set.
The specified time I set is 300000ms(5mins), yet I get a timeout error(408)
after approx. 30secs. I have tried using
HttpURLConnection<eclipse-javadoc:%E2%98%82=SyncMLClient/src%3Ccom.synchronica.ds.transport%7BHTTPTransporter.java%E2%98%83HTTPTransporter%5EmConn%E2%98%82HttpURLConnection>
and DefaultHttpClient,
I get the same error for both. The code works ok for server response time
less than 30s. I have even tried setting timeout value to 0(infinite).
The device doesn't enter sleep mode.
Code used to set timeouts for methods is below:
*HttpURLConnection *
URL connURL = new URL(url);
HttpURLConnection conn = (HttpURLConnection)
connURL.openConnection();
conn.setDoOutput(true);
conn.setDoInput(true);
conn.setConnectTimeout(300000);
conn.setReadTimeout((300000);
conn.setRequestMethod("POST");
.....
*DefaultHttpClient*
HttpParams httpParameters = new BasicHttpParams();
HttpConnectionParams.setConnectionTimeout(httpParameters, 300000);
HttpConnectionParams.setSoTimeout(httpParameters, 300000);
DefaultHttpClient httpClient = new
DefaultHttpClient(httpParameters);
HttpPost httpost = new HttpPost(url);
.....
Thanks in advance for any assistance.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en