Gio.SocketListener.prototype.accept_socket
function accept_socket(cancellable: Gio.Cancellable): [return_value: Gio.Socket, source_object: GObject.Object] { // Gjs wrapper for g_socket_listener_accept_socket() }
Blocks waiting for a client to connect to any of the sockets added to the listener. Returns the Gio.Socket that was accepted.
If you want to accept the high-level Gio.SocketConnection, not a Gio.Socket, which is often the case, then you should use Gio.SocketListener.prototype.accept instead.
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.Socket on success, null on error.
- source_object
location where GObject.Object pointer will be stored, or null.