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

No timeout for dns host name lookup #327

Open
foodied opened this issue Mar 18, 2019 · 3 comments
Open

No timeout for dns host name lookup #327

foodied opened this issue Mar 18, 2019 · 3 comments

Comments

@foodied
Copy link

foodied commented Mar 18, 2019

Describe the bug
I set the timeout as usual but in a scenario when the network is connected but the internet is not available to complete a DNS lookup, there are no callbacks for a quite amount of time. How do we handle this?

I am using ReactiveNetwork.checkInternetConnectivity().

To Reproduce
Steps to reproduce the behavior:

  1. Connect to a wifi source which doesn't have a working connection.
  2. Start the app and observe.
@pwittchen
Copy link
Owner

Thanks for reporting that. I'm not really sure how to handle this particular use case. Probably I'll need more time for analysing that.

@foodied
Copy link
Author

foodied commented Mar 18, 2019

I am not sure just guessing. It's just what others are saying.

Inside isConnected(),

  1. First we check the address InetAddress.getByName() from hostname.
  2. Use the above in a thread and terminate that thread after the desired timeout (by user). If the timeout has been reached, send an error callback else to proceed.
  3. Supply that InetAddress to the URL class instead of the original hostname (by user). So no extra lookups.

What are your thoughts?

@Polyterative
Copy link

Use the above in a thread and terminate that thread after the desired timeout (by user)

Obviously @pwittchen leave a default of like 5 secs

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

No branches or pull requests

3 participants