def dispatch(self, pdu):
    if isinstance(pdu, Symmetry):
        return
    if isinstance(pdu, AggregatedFrame):
        if ((pdu.dsap == 0) and (pdu.ssap == 0)):
            [log.debug(('     ' + str(p))) for p in pdu]
            [self.dispatch(p) for p in pdu]
        return
    if (isinstance(pdu, Connect) and (pdu.dsap == 1)):
        addr = self.snl.get(pdu.sn)
        if ((not addr) or (self.sap[addr] is None)):
            log.debug("no service named '{0}'".format(pdu.sn))
            pdu = DisconnectedMode(pdu.ssap, 1, reason=2)
            self.sap[1].dmpdu.append(pdu)
            return
        pdu = Connect(dsap=addr, ssap=pdu.ssap, rw=pdu.rw, miu=pdu.miu)
    with self.lock:
        sap = self.sap[pdu.dsap]
        if sap:
            sap.enqueue(pdu)
            return
    log.debug('discard PDU {0}'.format(str(pdu)))
    return
def dispatch(self, pdu):
    if isinstance(pdu, Symmetry):
        return
    if isinstance(pdu, AggregatedFrame):
        if ((pdu.dsap == 0) and (pdu.ssap == 0)):
            [log.debug(('     ' + str(p))) for p in pdu]
            [self.dispatch(p) for p in pdu]
        return
    if (isinstance(pdu, Connect) and (pdu.dsap == 1)):
        addr = self.snl.get(pdu.sn)
        if ((not addr) or (self.sap[addr] is None)):
            log.debug("no service named '{0}'".format(pdu.sn))
            pdu = DisconnectedMode(pdu.ssap, 1, reason=2)
            self.sap[1].dmpdu.append(pdu)
            return
        pdu = Connect(dsap=addr, ssap=pdu.ssap, rw=pdu.rw, miu=pdu.miu)
    with self.lock:
        sap = self.sap[pdu.dsap]
        if sap:
            sap.enqueue(pdu)
            return
    log.debug('discard PDU {0}'.format(str(pdu)))
    return