Browse for and resolve mDNS/DNS-SD services. More...
Classes | |
| class | DNSServiceRef |
| A running service discovery operation. More... | |
Functions | |
| def | stop |
| Stop the thread handling communication with the DNS-SD service. More... | |
| def | browse_callback |
| Callback type for browse(). More... | |
| def | browse |
| Browse for services. More... | |
| def | resolve_callback |
| Callback type for resolve(). More... | |
| def | resolve |
| Resolve a service instance. More... | |
Variables | |
| int | FlagsMoreComing = 1 |
| kDNSServiceFlags... More... | |
| int | FlagsAdd = 2 |
| kDNSServiceFlags... More... | |
| int | Err_NotInitialized = -65545 |
| kDNSServiceErr... More... | |
Browse for and resolve mDNS/DNS-SD services.
Unless specified otherwise, the API follows the Bonjour DNS-SD API specified in dns_sd.h (Apple docs).
| def INIXDnsSd.browse | ( | regtype, | |
| callback, | |||
domain = None, |
|||
interfaceIndex = 0 |
|||
| ) |
Browse for services.
Starts an asynchronous browse operation that runs until stopped through the returned DNSServiceRef.
The callback will be called in the INIX Python thread.
Any errors will be reported asynchronously through the callback. In addition to the errors specified in dns_sd.h, Err_NotInitialized = -65545 is reported when no DNS-SD library could be loaded.
| regtype | Service type, e.g. "_ftp._tcp". |
| callback | Callback function for results and errors. See browse_callback(). |
| domain,interfaceIndex | See DNSServiceBrowse(). |
| def INIXDnsSd.browse_callback | ( | self, | |
| flags, | |||
| interfaceIndex, | |||
| errorCode, | |||
| serviceName, | |||
| regtype, | |||
| replyDomain | |||
| ) |
Callback type for browse().
(This function does nothing, it just exists to document the arguments received by the callback function.)
| self | The DNSServiceRef representing the browse operation. |
| flags,interfaceIndex,errorCode,serviceName,regtype,replyDomain | See DNSServiceBrowseReply. |
| def INIXDnsSd.resolve | ( | name, | |
| regtype, | |||
| domain, | |||
| callback, | |||
interfaceIndex = 0 |
|||
| ) |
Resolve a service instance.
Starts an asynchronous resolution operation that runs until stopped through the returned DNSServiceRef.
The callback will be called in the INIX Python thread.
Any errors will be reported asynchronously through the callback. In addition to the errors specified in dns_sd.h, Err_NotInitialized = -65545 is reported when no DNS-SD library could be loaded.
| callback | Callback function for results and errors. See resolve_callback(). |
| name,regtype,domain,interfaceIndex | See DNSServiceResolve(). |
| def INIXDnsSd.resolve_callback | ( | self, | |
| flags, | |||
| interfaceIndex, | |||
| errorCode, | |||
| fullname, | |||
| hosttarget, | |||
| port, | |||
| txtRecord | |||
| ) |
Callback type for resolve().
(This function does nothing, it just exists to document the arguments received by the callback function.)
| self | The DNSServiceRef representing the browse operation. |
| flags,interfaceIndex,errorCode,fullname,hosttarget,port | See DNSServiceResolveReply. |
| txtRecord | The TXT record as a Python dictionary with bytes keys and bytes or True values. |
| def INIXDnsSd.stop | ( | ) |
Stop the thread handling communication with the DNS-SD service.
This is automatically done when the process ends, but can be done earlier if desired. May be called any number of times, a new thread will later be started when needed.
This does not stop any ongoing operations – these should first be stopped using DNSServiceRef.stop(), otherwise resources used by them will not be reclaimed.
| int INIXDnsSd.Err_NotInitialized = -65545 |
kDNSServiceErr...
from dns_sd.h
| int INIXDnsSd.FlagsAdd = 2 |
kDNSServiceFlags...
from dns_sd.h
| int INIXDnsSd.FlagsMoreComing = 1 |
kDNSServiceFlags...
from dns_sd.h
1.8.8