create_source


Description:

public DatagramBasedSource create_source (IOCondition condition, Cancellable? cancellable = null)

Creates a SocketSource that can be attached to a MainContext to monitor for the availability of the specified condition on the DatagramBased.

The SocketSource keeps a reference to the this.

The callback on the source is of the DatagramBasedSourceFunc type.

It is meaningless to specify g_io_err or g_io_hup in condition ; these conditions will always be reported in the callback if they are true.

If non-null, cancellable can be used to cancel the source, which will cause the source to trigger, reporting the current condition (which is likely 0 unless cancellation happened at the same time as a condition change). You can check for this in the callback using is_cancelled.

Parameters:

this

a DatagramBased

condition

a IOCondition mask to monitor

cancellable

a Cancellable

Returns:

a newly allocated SocketSource




2022 vala-language.org