hgoebl / DavidWebb

Lightweight Java HTTP-Client for calling JSON REST-Services (especially for Android)
https://hgoebl.github.io/DavidWebb/
MIT License
127 stars 41 forks source link

Canceling a request #17

Open Murphybro2 opened 8 years ago

Murphybro2 commented 8 years ago

I keep the connection open by holding the request on the server and not releasing it until something happens or the 30 seconds passes. However when I suddenly log out or an exception occurs I need something that will close the connection and cancel any outstanding requests. Does this function exist?

hgoebl commented 8 years ago

Seems to be rather complicated (searching StackOverflow e.g.), see

I haven't tried it, but maybe OkHttp could help you: https://github.com/square/okhttp/wiki/Recipes#canceling-a-call