Open abdur999 opened 3 years ago
Same issue with the Rx2DnssdBindable version, I am using jdk 1.8 Is there any issue in my code ?
public void discover() { clear(); mRxDnssd = new Rx2DnssdBindable(this.mContext); Log.d("TAG", "Service Discover called from NsdHelper"); mDisposable = mRxDnssd.browse("_services._dns-sd._udp", "local.") .compose(mRxDnssd.resolve()) .compose(mRxDnssd.queryIPRecords()) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(bonjourService -> { Log.d("TAG", bonjourService.toString()); if (bonjourService.isLost()) { Log.d(TAG, "Service discovery failed"); } else { Log.d(TAG, "Service discovery found"); serviceArr.add(bonjourService); handler.networkDiscover(serviceArr); } }, throwable -> Log.e("TAG", " discover error is", throwable));
}
public void clear()
{
if (mDisposable != null) {
mDisposable.dispose();
}
mDisposable = null;
}
You can't resolve services from _services._dns-sd._udp. You should just browse them, retrieve information about domains in your local network. And then start browsing in a particular domain. Please take a look at BonjourBrowser
@abdur999 Please try Rx2DnssdBindable
Originally posted by @andriydruk in https://github.com/andriydruk/RxDNSSD/issues/73#issuecomment-877177141