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

Adding custom addresses to check for connection #10

Open
mohammadamirnm opened this issue Aug 12, 2020 · 2 comments
Open

Adding custom addresses to check for connection #10

mohammadamirnm opened this issue Aug 12, 2020 · 2 comments

Comments

@mohammadamirnm
Copy link

mohammadamirnm commented Aug 12, 2020

It would be a great enhancement if you could add a property to add custom addresses instead of the default ones.
example code would be:

DataConnectionChecker(ipAddresses:<ipAddress>[]);
@jose-at-gabriel
Copy link

jose-at-gabriel commented Dec 1, 2020

That's indeed an awesome feature. Today, CloudFlare's DNS server isn't responding pings, but we have to wait for 10 seconds (DEFAULT_TIMEOUT) end then try to ping another ip.

@guyluz11
Copy link

guyluz11 commented Jan 6, 2021

If I understand you correctly this is already exist

  final List<AddressCheckOptions> DEFAULTADDRESSES = List<AddressCheckOptions>.unmodifiable([
      AddressCheckOptions(
        InternetAddress('1.1.1.1'), // CloudFlare
      ),
      AddressCheckOptions(
        InternetAddress('208.67.222.222'), // OpenDNS
      ),
    ]);

  DataConnectionChecker().addresses = DEFAULTADDRESSES;

  bool result = await DataConnectionChecker().hasConnection;

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

3 participants