[307:14] static extends: object
Generated metadata helpers for SocketListener class surfaces.
properties ()
Returns property metadata for
SocketListener.
A list.signals ()
Returns signal metadata for
SocketListener.
A list.[23:7] extends: object
A GSocketListener is an object that keeps track of a set of server sockets
and helps you accept sockets from any of the socket, either sync or async.
Add addresses and ports to listen on using
[method@Gio.SocketListener.add_address] and
[method@Gio.SocketListener.add_inet_port]. These will be listened on until
[method@Gio.SocketListener.close] is called. Dropping your final reference to
the GSocketListener will not cause [method@Gio.SocketListener.close] to be
called implicitly, as some references to the GSocketListener may be held
internally. If you want to implement a network server, also look at
[class@Gio.SocketService] and [class@Gio.ThreadedSocketService] which are
subclasses of GSocketListener that make this even easier.
SocketListener ()
Creates a new #GSocketListener with no sockets to listen for. New listeners can be added with e.g. g_socket_listener_add_address() or g_socket_listener_add_inet_port().
toNativeHandle (Source)
Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from
fn.call(...), another generated wrapper exposinghandle(), or null. Returns null when the argument carries no pointer.
Source is the raw handle, raw buffer, wrapper, or null.A raw pointer carrier or null when no pointer is present.getLib ()
Returns the opened native library for this generated wrapper.
The opened native library.handle ()
Returns the wrapped NativeHandle.
The wrapped NativeHandle.isNull ()
Returns true when the wrapped handle is null.
A bool.describe ()
Returns a small string for debugging generated wrappers.
A string.asObject ()
Wraps this handle as
Object.
A Object object.connectSignal (string Name, CallbackObj)
Connects one generated callback wrapper to a named signal.
Name is the signal name.CallbackObj is the generated callback wrapper to connect.The connected handler id.disconnectSignalHandler (int HandlerId)
Disconnects one retained signal handler id.
HandlerId is the signal handler id to disconnect.None.setOnEvent (callback Fn, UserData = null)
Emitted when @listener's activity on @socket changes state. Note that when @listener is used to listen on both IPv4 and IPv6, a separate set of signals will be emitted for each, and the order they happen in is undefined.
Fn is the Aussom callback.Fn is called with (SocketListener Self, string Event, Socket Socket).UserData is retained and passed through to the generated callback wrapper when provided.The connected handler id.getProperty (string Name)
Reads one generated property by name.
setProperty (string Name, Value)
Writes one generated property by name.
setListenbacklog (int Value)
The number of outstanding connections in the listen queue.
Value is the new property value.None.add_socket (object socket, object source_object)
Adds @socket to the set of sockets that we try to accept new clients from. The socket must be bound to a local address and listened to. For parallel calls to [class@Gio.SocketListener] methods to work, the socket must be in non-blocking mode. (See [property@Gio.Socket:blocking].)
will be passed out in the various calls to accept to identify this particular source, which is useful if you're listening on multiple addresses and do different things depending on what address is connected to. The @socket will not be automatically closed when theis finalized unless the listener held the final reference to the socket. Before GLib 2.42, the @socket was automatically closed on finalization of the @listener, even if references to it were held elsewhere.socket is a listening #GSocket.source_object is Optional #GObject identifying this source.close ()
Closes all the sockets in the listener.
None.set_backlog (int listen_backlog)
Sets the listen backlog on the sockets in the listener. This must be called before adding any sockets, addresses or ports to the #GSocketListener (for example, by calling g_socket_listener_add_inet_port()) to be effective. See g_socket_set_listen_backlog() for details
listen_backlog is an integer.None.[235:7] extends: object
Generated low-level callback wrapper for GIR callback event.
SocketListenerEventCallback (callback Fn, UserData = null)
Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking
Fn.
Fn is the Aussom callback implementation.UserData is retained and passed through to Fn on each invocation when provided.trampoline (nativeSelf, event, socket, nativeUserData)
Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.
callback ()
Returns the wrapped NativeCallback.
handle ()
Returns the callback as a NativeHandle.
close ()
Closes the underlying NativeCallback.
isClosed ()
Returns true when the callback has been closed.