'Ends the background threads, and prevent this instance from
servicing further queries.'

def close(self):

    if (globals()['_GLOBAL_DONE'] == 0):
        globals()['_GLOBAL_DONE'] = 1
        self.notifyAll()
        self.engine.notify()
        self.unregisterAllServices()
        self.socket.setsockopt(socket.SOL_IP, socket.IP_DROP_MEMBERSHIP, (socket.inet_aton(_MDNS_ADDR) + socket.inet_aton('0.0.0.0')))
        self.socket.close()
