Open swy0710 opened 5 years ago
Hi
30-60 sec it's not ok. Do you use a sample from this repo or build own? Could you also check this app Service Browser? Delay could be a 1-2 sec, but not 30. Please write on what device do you test?
Rx2DnssdBindable relay on non-public API - mDNSResponder daemon, there is no CTS test for the device maker to check this. Samsung in 4.3 just break it, in 5.0 it fixed again. You can use it on your own risk.
This probably should work just because of mDNSResponder support it. There is could be an issue if your device doesn't support ipv6. Please write on what device do you test?
PS: did you consider to use NSDManager from Android instead of jmdns?
@andriydruk Thank you for quick response.
First of all, I am testing with Pixel2 and it is the same phenomenon in all my phones. (Samsung Galaxy note 8, LG V50, Pixel1, etc.)
PS: Using NSDManager causes a TXT Record issue. So I can not use NSDManager.
@andriydruk
I tested it here with a sample app in this repository by repeatedly clicking startBrowsing and stopBrowsing. I click startBrowsing first, and when the device is found, I click stopBrowsing and then click startBrowsing again. Repeatedly as above, the device will be found periodically late.
Could I possibly handle the error with a try catch?
Thanks for your check.
I know that NSDManager supports TXT Record. However, as a result of my testing, I can not get the data because of failing to resolve periodically.
@andriydruk
I didn't change any code except for a regType for my device. I can get a response in 1 ~ 2 sec with Rx2DnssdBindable but 20 ~ 60 sec with Rx2DnssdEmbedded if it is late.
The log for Rx2DnssdEmbedded is like below. Browsing start time : 10:53:10 Device found time : 10:53:29
06-21 10:53:10.887 I 24417 DNSSDEmbedded already started 06-21 10:53:10.888 E 24417 DNSSD browse() in DNSSD 06-21 10:53:29.000 E 24417 DNSSD serviceFound() in DNSSD 06-21 10:53:29.002 I 24417 DNSSDEmbedded already started 06-21 10:53:29.002 E 24417 DNSSD resolve() in DNSSD 06-21 10:53:29.060 E 24417 DNSSD serviceResolved() in DNSSD 06-21 10:53:29.062 I 24417 DNSSDEmbedded already started 06-21 10:53:29.062 E 24417 DNSSD queryRecord() in DNSSD 06-21 10:53:29.063 I 24417 DNSSDEmbedded already started 06-21 10:53:29.063 E 24417 DNSSD queryRecord() in DNSSD 06-21 10:53:29.082 E 24417 DNSSD queryAnswered() in DNSSD
I can confirm the extension of loading time when repeatedly calling start/stop. Also a similar issue is with hosting a service. If one repeatedly starts and stops DNSSDEmbedded, the serviceRegistered callback is not called anymore. Scanning tested on Android 6 & 9, service registration on 8.
So the registration seems to be not working, if the last service is still running (but to be closed). A listener on socket.stop() would be great here to check, if the old service terminated already.
Service browsing shows a very strange behavior. Sometimes it is really fast and sometimes it just takes ages.
Holy shots the bindable version is fast :+1: No problems on this one...
@PSGXerus Bindable version is really fast! But there could be a browsing problem with some samsung phones.
But the bindable version never delivers a callback on a service registration. And now I got old services opened somewhere and I cant unregister them any more
@PSGXerus Bindable version is really fast! But there could be a browsing problem with some samsung phones.
yea. So @andriydruk if you could fix the embedded version by any chance, this would be great. If we can help somehow, let us know. I also noticed your app on the play store has got the same issue.
Also happens sometimes with multiple restarts:
I/DNSSDEmbedded: init I/DNSSDEmbedded: start A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x28 in tid 10201 (DNS-SDEmbedded)
I considered completely switching to the bindable version till the embedded is fixed, but it can't register services.
I considered completely switching to the bindable version till the embedded is fixed, but it can't register services.
Ok, the registration with the bindable version works. Somehow the buggy DNSSDEmbedded cloaked my phone or router. After restart of both and clean install of my app, registration with the bindable version works flawless.
@andriydruk How long will it take to resolve the issue? I'm looking forward to using this library.
com.github.druk.dnssd.AppleDNSSDException: DNS-SD Error -65540: BAD_PARAM
This is my cod. any issue? public void discover() { clear(); mRxDnssd = new Rx2DnssdEmbedded(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;
}
@abdur999 Please try Rx2DnssdBindable
I am using jmdns to find devices. However, there is a problem that the device is not found sometimes, so I am wondering whether to use RxDNSSD.
I have tested the RxDNSSD and found the following problem.
Thanks in advance for your advice.