def sendto(self, socket, message, dest):
    if (not isinstance(socket, TransmissionControlObject)):
        raise Error(errno.ENOTSOCK)
    if isinstance(socket, RawAccessPoint):
        if (not isinstance(message, ProtocolDataUnit)):
            raise TypeError('message must be a pdu on raw access point')
        if (not socket.is_bound):
            self.bind(socket)
        socket.send_miu = self.cfg['send-miu']
        return socket.send(message)
    if (not (type(message) == StringType)):
        raise TypeError('sendto() argument *message* must be a string')
    if isinstance(socket, LogicalDataLink):
        if (dest is None):
            raise Error(errno.EDESTADDRREQ)
        if (not socket.is_bound):
            self.bind(socket)
        socket.send_miu = self.cfg['send-miu']
        return socket.sendto(message, dest)
    if isinstance(socket, DataLinkConnection):
        return socket.send(message)
def sendto(self, socket, message, dest):
    if (not isinstance(socket, TransmissionControlObject)):
        raise Error(errno.ENOTSOCK)
    if isinstance(socket, RawAccessPoint):
        if (not isinstance(message, ProtocolDataUnit)):
            raise TypeError('message must be a pdu on raw access point')
        if (not socket.is_bound):
            self.bind(socket)
        socket.send_miu = self.cfg['send-miu']
        return socket.send(message)
    if (not (type(message) == StringType)):
        raise TypeError('sendto() argument *message* must be a string')
    if isinstance(socket, LogicalDataLink):
        if (dest is None):
            raise Error(errno.EDESTADDRREQ)
        if (not socket.is_bound):
            self.bind(socket)
        socket.send_miu = self.cfg['send-miu']
        return socket.sendto(message, dest)
    if isinstance(socket, DataLinkConnection):
        return socket.send(message)