I have a problem of getting the registered services port numbers. Actually my application registers a service with port xxxx (e.g 40206), and the registration is done successfully. On the other device, when I registered discovery to discover all of the registered services, I found the service successfully with a valid Host name, but wrong port number, it always returns port 41.
@Override
public void onServiceResolved(NsdServiceInfo serviceInfo) {
Log.d(TAG, serviceInfo.getPort());
}
Any help why it happens and how to solve it?