create_source
Description:
Creates a SocketSource that triggers when this
can be read, or cancellable
is triggered or an error occurs.
The callback on the source is of the PollableSourceFunc type.
As with is_readable, it is possible that the stream may not actually be readable even after the source triggers, so you should use read_nonblocking rather than read from the callback.
The behaviour of this method is undefined if can_poll returns false for this.
Parameters:
this | |
cancellable |
a Cancellable, or null |
Returns:
a new SocketSource |