def enqueue(self, pdu):
    with self.llc.lock:
        if isinstance(pdu, Connect):
            for socket in self.sock_list:
                if socket.state.LISTEN:
                    socket.enqueue(pdu)
                    return
        else:
            for socket in self.sock_list:
                if ((pdu.ssap == socket.peer) or (socket.peer is None)):
                    socket.enqueue(pdu)
                    return
        if (pdu.type in connection_mode_pdu_types):
            self.send(DisconnectedMode(pdu.ssap, pdu.dsap, reason=1))
def enqueue(self, pdu):
    with self.llc.lock:
        if isinstance(pdu, Connect):
            for socket in self.sock_list:
                if socket.state.LISTEN:
                    socket.enqueue(pdu)
                    return
        else:
            for socket in self.sock_list:
                if ((pdu.ssap == socket.peer) or (socket.peer is None)):
                    socket.enqueue(pdu)
                    return
        if (pdu.type in connection_mode_pdu_types):
            self.send(DisconnectedMode(pdu.ssap, pdu.dsap, reason=1))