def sendto(self, string, address, flags=0):
        'Encrypt and send datagram on socket.'
        string = _encode(string, self.__em1, self.__em2)
        sent = self.__socket.sendto(string, flags, address)
        offset = sent % 4
        if offset:
            string = string[sent:][:4-offset]
            sent += len(string)
            while string:
                string = string[self.socket.sentto(string, flags, address):]
        return sent / 4
Encrypt and send datagram on socket.
recipes/Python/572159_SPICE/recipe-572159.py