-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make DNSSD queries cancellable #32
Comments
I don't see any warnings locally with #33. Which Swift version are you using? Would you be able to give changes in that PR a try to see if it works for you? |
I'm using Swift 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4) and I get the warning The changes in the PR don't seem to work.
In my example I put "" as the service name, but I believe it happens with any SRV query that has no answer. |
But instead of having a timeout/deadline we check for The existing reply handling code should do what Hopefully the code involved (e.g., Note that the referenced SO response is from 10 years ago. Maybe there are newer/better ways to do this. @victorherrerod Is this something you want to try looking into? |
If you want to wake a |
Instead of using I've tested this a bit and it seems to work correctly, my code snippet above behaves as expected and the task cancels after 3 seconds. The main doubt I have is removing However, I still have the PD: I amended the commit to have the author linked to my account |
Hi!
First of all, thanks for this great lib!
I'd like to be able to cancel queries made with the DNSSD Resolver, because the timeout is pretty long and it would be nice to be able to cancel the Task after a custom timeout.
I've seen that the cancellation behavior is implemented for the Ares Resolver and I've tried to make it work for the DNSSD Resolver.
I implemented the
onTermination
method of the stream continuation, however this produces a warning when trying to callDNSServiceRefDeallocate
on the pointer, since it isn't a Sendable type and it could be modified by several threads at the same time.I am not very experienced in the inner workings of Swift concurrency, how could the DNSSD queries cancellation be implemented?
Thanks and have a nice day!
The text was updated successfully, but these errors were encountered: