PollableInputStreamT

GPollableInputStream is implemented by gio.InputStreams that can be polled for readiness to read. 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 GPollableInputStream but have only certain instances of that class be pollable. If this method returns FALSE, then the behavior of other GPollableInputStream methods is undefined.

createSource
Source createSource(Cancellable cancellable)

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

getPollableInputStreamStruct
GPollableInputStream* getPollableInputStreamStruct(bool transferOwnership)

Get the main Gtk struct

isReadable
bool isReadable()

Checks if stream can be read.

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

Attempts to read up to count bytes from stream into buffer, as with InputStream.read. If stream is not currently readable, this will immediately return G_IO_ERROR_WOULD_BLOCK, and you can use g_pollable_input_stream_create_source() to create a glib.Source that will be triggered when stream is readable.

Meta

Since

2.28