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

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

Open
lukaszkalnik opened this issue Jul 28, 2020 · 2 comments
Open

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

lukaszkalnik opened this issue Jul 28, 2020 · 2 comments

Comments

@lukaszkalnik
Copy link

lukaszkalnik commented Jul 28, 2020

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.

@andriydruk
Copy link
Owner

andriydruk commented Jul 28, 2020

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.

@lukaszkalnik
Copy link
Author

lukaszkalnik commented Jul 28, 2020

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.

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

No branches or pull requests

2 participants