Basics
Guides
API Reference
Basics
Guides
API Reference
[16:7] extends: object
GSocketAddress is the equivalent of struct sockaddr and its subtypes in the BSD sockets API. This
is an abstract class; use [class@Gio.InetSocketAddress] for internet sockets,
or [class@Gio.UnixSocketAddress] for UNIX domain sockets.
SocketAddress (native = null, len = null)
Creates a #GSocketAddress subclass corresponding to the native struct sockaddr @native.
native is a pointer to a struct sockaddr.len is the size of the memory location pointed to by @native.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.asSocketConnectable ()
Wraps this handle as
SocketConnectable.
A SocketConnectable object.get_family ()
Gets the socket family type of @address.
get_native_size ()
Gets the size of @address's native struct sockaddr. You can use this to allocate memory to pass to g_socket_address_to_native().
to_native (dest, int destlen)
Converts a #GSocketAddress to a native struct sockaddr, which can be passed to low-level functions like connect() or bind(). If not enough space is available, a %G_IO_ERROR_NO_SPACE error is returned. If the address type is not known on the system then a %G_IO_ERROR_NOT_SUPPORTED error is returned.
dest is a pointer to a memory location that will contain the native struct sockaddr.destlen is the size of @dest. Must be at least as large as g_socket_address_get_native_size().[157:14] static extends: object
Generated metadata helpers for SocketAddress class surfaces.
properties ()
Returns property metadata for
SocketAddress.
A list.
Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.