Classes | Functions | Variables
INIXDnsSd Namespace Reference

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...
 

Detailed Description

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).


Function Documentation

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.

Parameters
regtypeService type, e.g. "_ftp._tcp".
callbackCallback function for results and errors. See browse_callback().
domain,interfaceIndexSee DNSServiceBrowse().
Returns
DNSServiceRef
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.)

Parameters
selfThe DNSServiceRef representing the browse operation.
flags,interfaceIndex,errorCode,serviceName,regtype,replyDomainSee 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.

Parameters
callbackCallback function for results and errors. See resolve_callback().
name,regtype,domain,interfaceIndexSee DNSServiceResolve().
Returns
DNSServiceRef
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.)

Parameters
selfThe DNSServiceRef representing the browse operation.
flags,interfaceIndex,errorCode,fullname,hosttarget,portSee DNSServiceResolveReply.
txtRecordThe 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.

Variable Documentation

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


Generated by doxygen 1.8.8