Skip to content

Provide example of asking a QU Question #702

Closed

Description

Activity

  1. self-assigned this
    on Jun 17, 2021
  2. bdraco commented on Jun 18, 2021

    @bdraco
    MemberAuthor
    class ServiceBrowser(_ServiceBrowserBase, threading.Thread):
        """Used to browse for a service of a specific type.
    
        The listener object will have its add_service() and
        remove_service() methods called when this browser
        discovers changes in the services availability."""
    
        def __init__(
            self,
            zc: 'Zeroconf',
            type_: Union[str, list],
            handlers: Optional[Union['ServiceListener', List[Callable[..., None]]]] = None,
            listener: Optional['ServiceListener'] = None,
            addr: Optional[str] = None,
            port: int = _MDNS_PORT,
            delay: int = _BROWSER_TIME,
        ) -> None:
            threading.Thread.__init__(self)
            super().__init__(zc, type_, handlers=handlers, listener=listener, addr=addr, port=port, delay=delay)
            self.daemon = True
            self.start()
            self.name = "zeroconf-ServiceBrowser-%s-%s" % (
                '-'.join([type_[:-7] for type_ in self.types]),
                getattr(self, 'native_id', self.ident),
            )
    
    

    We can already set an addr and port for a ServiceBrowser but there is no way to tell it to ask QU questions.

    Maybe a unicast = True

  3. bdraco commented on Jun 19, 2021

    @bdraco
    MemberAuthor

    ServiceInfo needs a unicast property. ServiceBrowser actually doesn't

  4. bdraco commented on Jun 20, 2021

    @bdraco
    MemberAuthor

    I think we need a QuestionType.QU, QuestionType.QM enum for both since we may want to force a ServiceBrowser or ServiceInfo to send QU questions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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