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

def close(self):

    global _GLOBAL_DONE
    if (not _GLOBAL_DONE):
        _GLOBAL_DONE = True
        self.notifyAll()
        self.engine.notify()
        self.unregisterAllServices()
        self.socket.setsockopt(socket.IPPROTO_IP, socket.IP_DROP_MEMBERSHIP, (socket.inet_aton(_MDNS_ADDR) + socket.inet_aton('0.0.0.0')))
        self.socket.close()
