File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 183183_TCP_PROTOCOL_LOCAL_TRAILER = '._tcp.local.'
184184_NONTCP_PROTOCOL_LOCAL_TRAILER = '._udp.local.'
185185
186+ # https://datatracker.ietf.org/doc/html/rfc6763#section-9
187+ _SERVICE_TYPE_ENUMERATION_NAME = "_services._dns-sd._udp.local."
188+
186189try :
187190 _IPPROTO_IPV6 = socket .IPPROTO_IPV6
188191except AttributeError :
@@ -2191,7 +2194,7 @@ def find(
21912194 """
21922195 local_zc = zc or Zeroconf (interfaces = interfaces , ip_version = ip_version )
21932196 listener = cls ()
2194- browser = ServiceBrowser (local_zc , '_services._dns-sd._udp.local.' , listener = listener )
2197+ browser = ServiceBrowser (local_zc , _SERVICE_TYPE_ENUMERATION_NAME , listener = listener )
21952198
21962199 # wait for responses
21972200 time .sleep (timeout )
@@ -2960,12 +2963,12 @@ def handle_query( # pylint: disable=too-many-branches
29602963
29612964 for question in msg .questions :
29622965 if question .type == _TYPE_PTR :
2963- if question .name == "_services._dns-sd._udp.local." :
2966+ if question .name == _SERVICE_TYPE_ENUMERATION_NAME :
29642967 for stype in self .registry .get_types ():
29652968 out .add_answer (
29662969 msg ,
29672970 DNSPointer (
2968- "_services._dns-sd._udp.local." ,
2971+ _SERVICE_TYPE_ENUMERATION_NAME ,
29692972 _TYPE_PTR ,
29702973 _CLASS_IN ,
29712974 _DNS_OTHER_TTL ,
You can’t perform that action at this time.
0 commit comments