views:

44

answers:

0

I am making a URLConnection to my companies server, and now that we have moved to the production server, I am receiving connection timeouts. It is known that the server is slow, so in order to accommodate it, I was asked to extend the amount of time before the connection times out on my device.

I checked my code, and saw that I had already called setConnectTimeout(0); which is supposed to be infinite timeout. So to test, I put in a ridiculously small value of 10ms to time out - but nothing changed. In fact, once the server was restarted, I was getting a response and data when I expected it to time out right away.

I found reports of the opposite problem with setSoTimeout() where the timeout always occurs after a long wait, even if the actual timeout should have occurred earlier. I have a shorter wait of roughly 40seconds, even though I've set the timeout to be infinite. Whatever parameter I place in setConnectTimeout() doesn't seem to have an affect.

I am running 2.2 on a Nexus One. Any thoughts or similar experiences?