'Write a datagram.'

def write(self, data):

    try:
        return self.socket.send(data)
    except socket.error as se:
        no = se.args[0]
        if (no == EINTR):
            return self.write(data)
        elif (no == EMSGSIZE):
            raise error.MessageLengthError('message    too    long')
        elif (no == ECONNREFUSED):
            self.protocol.connectionRefused()
        elif (no == EAGAIN):
            pass
        else:
            raise
