create_source
Description:
Creates a SocketSource that triggers when this
can be written, or cancellable
is triggered or an error occurs.
The callback on the source is of the PollableSourceFunc type.
As with is_writable, it is possible that the stream may not actually be writable even after the source triggers, so you should use write_nonblocking rather than write 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 |