PollableOutputStreamT.writevNonblocking

Attempts to write the bytes contained in the @n_vectors @vectors to @stream, as with g_output_stream_writev(). If @stream is not currently writable, this will immediately return %@G_POLLABLE_RETURN_WOULD_BLOCK, and you can use g_pollable_output_stream_create_source() to create a #GSource that will be triggered when @stream is writable. @error will *not* be set in that case.

Note that since this method never blocks, you cannot actually use @cancellable to cancel it. However, it will return an error if @cancellable has already been cancelled when you call, which may happen if you call this method after a source triggers due to having been cancelled.

Also note that if %G_POLLABLE_RETURN_WOULD_BLOCK is returned some underlying transports like D/TLS require that you re-send the same @vectors and @n_vectors in the next write call.

template PollableOutputStreamT(TStruct)
writevNonblocking

Parameters

vectors GOutputVector[]

the buffer containing the #GOutputVectors to write.

bytesWritten size_t

location to store the number of bytes that were written to the stream

cancellable Cancellable

a #GCancellable, or %NULL

Return Value

%@G_POLLABLE_RETURN_OK on success, %G_POLLABLE_RETURN_WOULD_BLOCK if the stream is not currently writable (and @error is *not* set), or %G_POLLABLE_RETURN_FAILED if there was an error in which case @error will be set.

Throws

GException on failure.

Meta

Since

2.60