PollableOutputStreamIF

GPollableOutputStream is implemented by gio.OutputStreams that can be polled for readiness to write. This can be used when interfacing with a non-GIO API that expects UNIX-file-descriptor-style asynchronous I/O rather than GIO-style.

Members

Functions

canPoll
bool canPoll()

Checks if stream is actually pollable. Some classes may implement GPollableOutputStream but have only certain instances of that class be pollable. If this method returns FALSE, then the behavior of other GPollableOutputStream methods is undefined.

createSource
Source createSource(Cancellable cancellable)

Creates a glib.Source that triggers when stream can be written, or cancellable is triggered or an error occurs. The callback on the source is of the GPollableSourceFunc type.

getPollableOutputStreamStruct
GPollableOutputStream* getPollableOutputStreamStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

isWritable
bool isWritable()

Checks if stream can be written.

writeNonblocking
ptrdiff_t writeNonblocking(ubyte[] buffer, Cancellable cancellable)

Attempts to write up to count bytes from buffer to stream, as with OutputStream.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 glib.Source that will be triggered when stream is writable.

writevNonblocking
GPollableReturn writevNonblocking(GOutputVector[] vectors, size_t bytesWritten, Cancellable cancellable)

Attempts to write the bytes contained in the n_vectors vectors to stream, as with OutputStream.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 glib.Source that will be triggered when stream is writable. error will *not* be set in that case.

Static functions

getType
GType getType()

Meta

Since

2.28