def accept(self, socket):
    if (not isinstance(socket, TransmissionControlObject)):
        raise Error(errno.ENOTSOCK)
    if (not isinstance(socket, DataLinkConnection)):
        raise Error(errno.EOPNOTSUPP)
    while True:
        client = socket.accept()
        if (not client.is_bound):
            self.bind(client)
        if self.sap[client.addr].insert_socket(client):
            log.debug('new data link connection ({0} <=== {1})'.format(client.addr, client.peer))
            return client
        else:
            pdu = DisconnectedMode(client.peer, socket.addr, reason=32)
            super(DataLinkConnection, socket).send(pdu)
def accept(self, socket):
    if (not isinstance(socket, TransmissionControlObject)):
        raise Error(errno.ENOTSOCK)
    if (not isinstance(socket, DataLinkConnection)):
        raise Error(errno.EOPNOTSUPP)
    while True:
        client = socket.accept()
        if (not client.is_bound):
            self.bind(client)
        if self.sap[client.addr].insert_socket(client):
            log.debug('new data link connection ({0} <=== {1})'.format(client.addr, client.peer))
            return client
        else:
            pdu = DisconnectedMode(client.peer, socket.addr, reason=32)
            super(DataLinkConnection, socket).send(pdu)