gIOStreamGetInputStream(object)
gIOStreamGetOutputStream(object)
gIOStreamClose(object, cancellable = NULL, .errwarn = TRUE)
gIOStreamCloseAsync(object, io.priority, cancellable = NULL, callback, user.data = NULL)
gIOStreamCloseFinish(object, result, .errwarn = TRUE)
gIOStreamIsClosed(object)
gIOStreamHasPending(object)
gIOStreamSetPending(object, .errwarn = TRUE)
gIOStreamClearPending(object)
GObject +----GIOStream +----GFileIOStream +----GSocketConnection
GIOStream
objects are GSocketConnection
which represents
a two-way network connection, and GFileIOStream
which represent a
file handle opened in read-write mode. To do the actual reading and writing you need to get the substreams
with gIOStreamGetInputStream
and gIOStreamGetOutputStream
. The GIOStream
object owns the input and the output streams, not the other
way around, so keeping the substreams alive will not keep the GIOStream
object alive. If the GIOStream
object is freed it will be closed, thus
closing the substream, so even if the substreams stay alive they will
always just return a G_IO_ERROR_CLOSED
for all operations. To close a stream use gIOStreamClose
which will close the common
stream object and also the individual substreams. You can also close
the substreams themselves. In most cases this only marks the
substream as closed, so further I/O on it fails. However, some streams
may support "half-closed" states where one direction of the stream
is actually shut down.closed
[logical : Read / Write]input-stream
[GInputStream
: * : Read]output-stream
[GOutputStream
: * : Read]