问题
I want to find server in my local network through android device. I am able to find it by using NSDManager
service with service type of server(e.g _workstation._tcp
is service type).
In my local network I have a
wifi router and a wifi repeater,
both have different SSID but same password. Wifi repeater is connected to router. Wifi repeater have same IP range as of router.
For example 192.168.0.1
is gateway of my router. IP of server is 192.168.0.100
. IP assign to wifi repeater is 192.168.0.101
and device connected to wifi repeater is 192.168.0.102
.
When android device is connected to router, NDSManager
service which run on application discovered service type of server and gives information about server. Following is output :
Example [xx:xx:xx:xx:xx:xx]
Where Example is local hostname of server and [xx:xx:xx:xx:xx:xx] is mac address of server.
But When device is connected to wifi repeater and I want to find same server then it is not discovered by NSDManager
service. It shows nothing.
Why this happened? is NSDManger right method/functionality to find server in local network? if not then How can I find server in local network?
来源:https://stackoverflow.com/questions/37699734/network-service-discovery-is-not-discover-service-type