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

Expose performIpLookup interface #27

Closed
andreadaoud opened this issue Oct 9, 2022 · 4 comments
Closed

Expose performIpLookup interface #27

andreadaoud opened this issue Oct 9, 2022 · 4 comments

Comments

@andreadaoud
Copy link

Description

Hi, I would like to convert xxxxxx.local address to IP address, but it seems that performIpLookup is not exposed. Could you please make it public so I can call it?

Scenario

Use the plugin in my own application via Flutter dependency

Platform

All of them

@sebastianhaberey
Copy link
Owner

Hi @andreadaoud,

why would you want to call the method directly? You can just specify IpLookupType.any when calling startDiscovery. That way the discovered services will contain all their IP addresses. See also here.

@andreadaoud
Copy link
Author

Thank you for your quick response and great work!

On Apple platform we can connect to the service using xxxxx.local address. But, on Android, especially older versions, we cannot connect with .local address. My use case involves saving the xxxx.local address to config file and connect to it later. Running startDiscovery every time to get address is an option, but from my point of view, it sounds better to resolve it directly.

@sebastianhaberey
Copy link
Owner

Ok, I get that. And is there any reason why you don't want to use dart:io's lookup method directly:

final addresses = await InternetAddress.lookup(host, type: InternetAddressType.any)

@sebastianhaberey
Copy link
Owner

Closing this since there seems to be an easy way to do this with basic Flutter functionality. Please feel free to open another issue if this doesn't solve your issue or you're missing anything else!

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