PollableOutputStreamT.gPollableOutputStreamWriteNonblocking

Attempts to write up to size bytes from buffer to stream, as with g_output_stream_write(). If stream is not currently writable, this will immediately return G_IO_ERROR_WOULD_BLOCK, and you can use g_pollable_output_stream_create_source() to create a GSource that will be triggered when stream is writable. 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. Virtual: write_nonblocking

template PollableOutputStreamT(TStruct)
gssize
gPollableOutputStreamWriteNonblocking

Parameters

buffer void[]

a buffer to write data from. [array length=size][element-type guint8]

cancellable Cancellable

a GCancellable, or NULL. [allow-none]

Return Value

Type: gssize

the number of bytes written, or -1 on error (including G_IO_ERROR_WOULD_BLOCK).

Throws

GException on failure.

Meta