Gio.SocketListener.prototype.accept
function accept(cancellable: Gio.Cancellable): [return_value: Gio.SocketConnection, source_object: GObject.Object] { // Gjs wrapper for g_socket_listener_accept() }
Blocks waiting for a client to connect to any of the sockets added to the listener. Returns a Gio.SocketConnection for the socket that was accepted.
If source_object is not null it will be filled out with the source object specified when the corresponding socket or address was added to the listener.
If cancellable is not null, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error Gio.IOErrorEnum.cancelled will be returned.
Since 2.22
- cancellable
optional Gio.Cancellable object, null to ignore.
- return_value
a Gio.SocketConnection on success, null on error.
- source_object
location where GObject.Object pointer will be stored, or null