Skip to content
This repository has been archived by the owner on May 26, 2022. It is now read-only.

@abdur999 Please try Rx2DnssdBindable #205

Open
abdur999 opened this issue Jul 9, 2021 · 2 comments
Open

@abdur999 Please try Rx2DnssdBindable #205

abdur999 opened this issue Jul 9, 2021 · 2 comments

Comments

@abdur999
Copy link

abdur999 commented Jul 9, 2021

@abdur999 Please try Rx2DnssdBindable

Originally posted by @andriydruk in #73 (comment)

@abdur999
Copy link
Author

abdur999 commented Jul 9, 2021

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;
}

Screenshot 2021-07-09 at 9 29 23 PM

@andriydruk
Copy link
Owner

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants