GPollableReturn writev_nonblocking ( GPollableOutputStream* stream, const GOutputVector* vectors, gsize n_vectors, gsize* bytes_written, GError** error )
Attempts to write the bytes contained in the
as with g_output_stream_writev(). If
stream is not currently writable,
this will immediately return %
G_POLLABLE_RETURN_WOULD_BLOCK, and you can
g_pollable_output_stream_create_source() to create a
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
cancellable to cancel it. However, it will return an error
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
n_vectors in the next write call.
Available since: 2.60
Type: An array of
The buffer containing the
The length of the array is specified in the
The data is owned by the caller of the function.
The number of vectors to write.
Location to store the number of bytes that were written to the stream.
The argument will be set by the function. The argument can be
The return location for a recoverable error.
The argument can be
If the return location is not
NULL, then you must initialize it to a
The argument will be left initialized to
NULLby the virtual function if there are no errors.
In case of error, the argument will be set to a newly allocated
GError; the caller will take ownership of the data, and be responsible for freeing it.
G_POLLABLE_RETURN_OK on success,
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