Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BetterHttpResponse send method hangs forever #49

Open
pauleyj opened this issue Jul 29, 2011 · 2 comments
Open

BetterHttpResponse send method hangs forever #49

pauleyj opened this issue Jul 29, 2011 · 2 comments

Comments

@pauleyj
Copy link

pauleyj commented Jul 29, 2011

When the underlying network changes from 3G to Wi-Fi, Wi-Fi to 3G, or the 3G signal is lost (say when you get in an elevator), if you are in the middle of executing a request, the send method hangs forever, no timeout, no retry logic, just hangs forever. Any ideas on how to handle this?

@mttkay
Copy link
Owner

mttkay commented Jul 29, 2011

There is a timeout. It's 30 seconds by default, and you can set it to any value you like. Globally do it via BetterHttp.setSocketTimeout(), and per-request using request.withTimeout().

It simply forwards to Apache HttpClient's timeout parameters.

@mttkay
Copy link
Owner

mttkay commented Jul 29, 2011

Also, make sure you require android.permission.ACCESS_NETWORK_STATE in your manifest file. This makes sure that BetterHttp's ConnectionChanged receiver is triggered, which makes sure to update proxy settings that your carrier may require when failing over from Wi-Fi to 3G.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants