RxDNSSD icon indicating copy to clipboard operation
RxDNSSD copied to clipboard

DNSSD.queryRecord doesn't call `operationFailed()` on timeout

Open lukaszkalnik opened this issue 4 years ago • 2 comments

Currently the DNSSD.queryRecord() implementation called with withTimeout = true doesn't call the operationFailed() callback of provided QueryListener if a timeout occurs. Instead it just silently stops the scan and that's it.

Also there is no way to set DNSSD.serviceTimeout when using e.g. DNSSDBindable - it has only one constructor. So the timeout is always set to default.

lukaszkalnik avatar Jul 28 '20 09:07 lukaszkalnik

Hi,

Yes, timeout is working in that way. DNSSD just stops search without any listener call. I guess it's too big a change that will break a lot of applications.

I would recommend building a timeout on your side. If you use the Rx library should be one line of code.

andriydruk avatar Jul 28 '20 10:07 andriydruk

Thanks for a super fast answer! Yes, that makes sense. We should not break existing apps.

What about allowing setting a custom timeout from DNSSDBindable? The DNSSD constructor which allows setting it is not accessible from any public API.

lukaszkalnik avatar Jul 28 '20 11:07 lukaszkalnik