codepath / CPAsyncHttpClient

Android CodePath AsyncHttpClient

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add .setTimeout() functionality

calren opened this issue · comments

commented

We can utilize the setClientTimeout() and setReadTimeout() from okhttp. https://stackoverflow.com/questions/25953819/how-to-set-connection-timeout-with-okhttp

This will help mitigate SocketTimeoutErrors

Good suggestion, this is especially useful for the book lab! @rogerhu would you be able to help with adding this pass through to bring back the setTimeout and releasing a new version?

I added setReadTimeout() and setConnectTimeout() to the API with seconds as default. Can you give it a try? The new version has been tagged as 2.1.0.

Thanks Roger! 🙏

@calren Do you think it is worth adding a setTimeout to mirror the older API which sets both of these at the same time or is this good as is?

commented

Oh great, I see Roger already added setTimeout() 216b2f6 😄

Thanks Roger!