number of messages sent, or -1 on error. Note that the number of messages sent may be smaller than @num_messages if @timeout is zero or positive, or if @num_messages was larger than UIO_MAXIOV (1024), in which case the caller may re-try to send the remaining messages.
GException on failure.