Closed francisyu1012 closed 5 months ago
Hey,
Why do you absolutely want the IP address instead of the hostname ? You're not using 140.82.121.4 to go on github.com, aren't you ?
It was more of a curiosity question regarding the discrepancy between scanning with Android vs. IOS and WIndows... Given the shift of using HTTPS which does not allow direct connection with IP's and .local, we will probably just use this to scan if the devices are in the same LAN. Thanks!
It was more of a curiosity question regarding the discrepancy between scanning with Android vs. IOS and WIndows...
Understood. On Darwin platforms, Bonsoir rely on NWBrowser
/ DNSServiceResolve
which only gives you the hostname. It should be possible to find the IP address using gethostbyname
or getaddrinfo
tho, as stated here.
Describe the bug When running with Android, I am able to see the the host as an IP address:
flutter (12628): Service resolved : {service.name: zz0138, service.type: _msb._tcp, service.port: 1505, service.attributes: {}, service.host: 192.168.4.126}
However in IOS and Windows, the response only gives me the hostname flutter: Service resolved : {service.name: zz0077, service.type: _msb._tcp, service.port: 1505, service.attributes: {}, service.host: zz0077.local.}
Why the discrepancy and Is it possible to get the IP directly from this service?
To Reproduce Steps to reproduce the behavior: Built in IOS, Android and Windows using this code block
Expected behavior A clear and concise description of what you expected to happen.
Desktop (please complete the following information):
Smartphone (please complete the following information):