Clears the pending flag on stream.
Closes the stream, releasing resources related to it. This will also close the individual input and output streams, if they are not already closed.
Requests an asynchronous close of the stream, releasing resources related to it. When the operation is finished callback will be called. You can then call gio.iostream.IOStream.closeFinish to get the result of the operation.
Closes a stream.
Gets the input stream for this object. This is used for reading.
Gets the output stream for this object. This is used for writing.
Checks if a stream has pending actions.
Checks if a stream is closed.
Sets stream to have actions pending. If the pending flag is already set or stream is closed, it will return false and set error.
Asynchronously splice the output stream of stream1 to the input stream of stream2, and splice the output stream of stream2 to the input stream of stream1.
Finishes an asynchronous io stream splice operation.
Set the GObject of a D ObjectG wrapper.
Get a pointer to the underlying C object.
Calls g_object_ref() on a GObject.
Calls g_object_unref() on a GObject.
Get the GType of an object.
GObject GType property.
Convenience method to return this cast to a type. For use in D with statements.
Template to get the D object from a C GObject and cast it to the given D object type.
Connect a D closure to an object signal.
Template for setting a GObject property.
Template for getting a GObject property.
Creates a binding between source_property on source and target_property on target.
Creates a binding between source_property on source and target_property on target, allowing you to set the transformation functions to be used by the binding.
This function is intended for #GObject implementations to re-enforce a floating[floating-ref] object reference. Doing this is seldom required: all #GInitiallyUnowneds are created with a floating reference which usually just needs to be sunken by calling gobject.object.ObjectG.refSink.
Increases the freeze count on object. If the freeze count is non-zero, the emission of "notify" signals on object is stopped. The signals are queued until the freeze count is decreased to zero. Duplicate notifications are squashed so that at most one #GObject::notify signal is emitted for each property modified while the object is frozen.
Gets a named field from the objects table of associations (see gobject.object.ObjectG.setData).
Gets a property of an object.
This function gets back user data pointers stored via gobject.object.ObjectG.setQdata.
Gets n_properties properties for an object. Obtained properties will be set to values. All properties must be valid. Warnings will be emitted and undefined behaviour may result if invalid properties are passed in.
Checks whether object has a floating[floating-ref] reference.
Emits a "notify" signal for the property property_name on object.
Emits a "notify" signal for the property specified by pspec on object.
Increase the reference count of object, and possibly remove the floating[floating-ref] reference, if object has a floating reference.
Releases all references to other objects. This can be used to break reference cycles.
Each object carries around a table of associations from strings to pointers. This function lets you set an association.
Sets a property on an object.
Remove a specified datum from the object's data associations, without invoking the association's destroy handler.
This function gets back user data pointers stored via gobject.object.ObjectG.setQdata and removes the data from object without invoking its destroy() function (if any was set). Usually, calling this function is only required to update user data pointers with a destroy notifier, for example:
Reverts the effect of a previous call to gobject.object.ObjectG.freezeNotify. The freeze count is decreased on object and when it reaches zero, queued "notify" signals are emitted.
This function essentially limits the life time of the closure to the life time of the object. That is, when the object is finalized, the closure is invalidated by calling gobject.closure.Closure.invalidate on it, in order to prevent invocations of the closure with a finalized (nonexisting) object. Also, gobject.object.ObjectG.ref_ and gobject.object.ObjectG.unref are added as marshal guards to the closure, to ensure that an extra reference count is held on object during invocation of the closure. Usually, this function will be called on closures that use this object as closure data.
Connect to Notify signal.
gio.iostream.IOStream represents an object that has both read and write streams. Generally the two streams act as separate input and output streams, but they share some common resources and state. For instance, for seekable streams, both streams may use the same position.
Examples of gio.iostream.IOStream objects are gio.socket_connection.SocketConnection, which represents a two-way network connection; and gio.file_iostream.FileIOStream, which represents a file handle opened in read-write mode.
To do the actual reading and writing you need to get the substreams with gio.iostream.IOStream.getInputStream and gio.iostream.IOStream.getOutputStream.
The gio.iostream.IOStream object owns the input and the output streams, not the other way around, so keeping the substreams alive will not keep the gio.iostream.IOStream object alive. If the gio.iostream.IOStream object is freed it will be closed, thus closing the substreams, so even if the substreams stay alive they will always return gio.types.IOErrorEnum.Closed for all operations.
To close a stream use gio.iostream.IOStream.close 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 but common state in the gio.iostream.IOStream may still be open. However, some streams may support ‘half-closed’ states where one direction of the stream is actually shut down.
Operations on gio.iostream.IOStreams cannot be started while another operation on the gio.iostream.IOStream or its substreams is in progress. Specifically, an application can read from the gio.input_stream.InputStream and write to the gio.output_stream.OutputStream simultaneously (either in separate threads, or as asynchronous operations in the same thread), but an application cannot start any gio.iostream.IOStream operation while there is a gio.iostream.IOStream, gio.input_stream.InputStream or gio.output_stream.OutputStream operation in progress, and an application can’t start any gio.input_stream.InputStream or gio.output_stream.OutputStream operation while there is a gio.iostream.IOStream operation in progress.
This is a product of individual stream operations being associated with a given glib.main_context.MainContext (the thread-default context at the time the operation was started), rather than entire streams being associated with a single glib.main_context.MainContext.
GIO may run operations on gio.iostream.IOStreams from other (worker) threads, and this may be exposed to application code in the behaviour of wrapper streams, such as gio.buffered_input_stream.BufferedInputStream or gio.tls_connection.TlsConnection. With such wrapper APIs, application code may only run operations on the base (wrapped) stream when the wrapper stream is idle. Note that the semantics of such operations may not be well-defined due to the state the wrapper stream leaves the base stream in (though they are guaranteed not to crash).