def enqueue(self, pdu):
    with self.llc.lock:
        if (isinstance(pdu, ServiceNameLookup) and (not (self.snl is None))):
            for (tid, sap) in pdu.sdres:
                try:
                    name = self.sent[tid]
                except KeyError:
                    pass
                else:
                    log.debug("resolved '{0}' to remote addr {1}".format(name, sap))
                    self.snl[name] = sap
                    self.tids.append(tid)
                    self.resp.notify_all()
            for (tid, name) in pdu.sdreq:
                try:
                    sap = self.llc.snl[name]
                except KeyError:
                    sap = 0
                self.sdres.append((tid, sap))
def enqueue(self, pdu):
    with self.llc.lock:
        if (isinstance(pdu, ServiceNameLookup) and (not (self.snl is None))):
            for (tid, sap) in pdu.sdres:
                try:
                    name = self.sent[tid]
                except KeyError:
                    pass
                else:
                    log.debug("resolved '{0}' to remote addr {1}".format(name, sap))
                    self.snl[name] = sap
                    self.tids.append(tid)
                    self.resp.notify_all()
            for (tid, name) in pdu.sdreq:
                try:
                    sap = self.llc.snl[name]
                except KeyError:
                    sap = 0
                self.sdres.append((tid, sap))