Reputation: 5597
I've got some trouble downloading a webpage's HTML (see this question: Android: Downloading HTML not always working).
In my code, I use this method:
HttpConnectionParams.setConnectionTimeout(my_httpParams, 3000);
I'm not really sure what it means. Does this mean that if it takes longer than 3000 millis to download the HTML file (for which I use it), it stops? Or does it mean something else?
Also, what it the difference between that method and setSoTimeout
?
Upvotes: 0
Views: 13415
Reputation: 39718
It means that if you haven't made a connection in 3000 ms, it will stop trying.
The setSoTimeout()
method is essentially the same thing, but it will wait for more than just the initial connection. So you would be checking each packet to see if it timed out, while the setConnectionTimeout()
method will only time out on the initial connection. See this answer for more details.
Upvotes: 7