Skip to content

Make DNSSD queries cancellable #32

@victorherrerod

Description

@victorherrerod

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 call DNSServiceRefDeallocate 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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions