Basics
Guides
API Reference
Basics
Guides
API Reference
[20:7] extends: object
GInetAddress represents an IPv4 or IPv6 internet address. Use
[method@Gio.Resolver.lookup_by_name] or
[method@Gio.Resolver.lookup_by_name_async] to look up the GInetAddress for
a hostname. Use [method@Gio.Resolver.lookup_by_address] or
[method@Gio.Resolver.lookup_by_address_async] to look up the hostname for a
GInetAddress. To actually connect to a remote host, you will need a
[class@Gio.InetSocketAddress] (which includes a GInetAddress as well as a
port number).
GInetAddress (family = null)
Creates a #GInetAddress for the "any" address (unassigned/"don't care") for @family.
family is the address family.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
GObject.
A GObject object.equal (object other_address)
Checks if two #GInetAddress instances are equal, e.g. the same address.
other_address is Another #GInetAddress..%TRUE if @address and @other_address are equal, %FALSE otherwise..get_family ()
Gets @address's family
@address's family.get_flowinfo ()
Gets the value of [property@Gio.InetAddress:flowinfo].
The flowinfo for the address, 0 if unset or not IPv6 address..get_is_any ()
Tests whether @address is the "any" address for its family.
%TRUE if @address is the "any" address for its family..get_is_link_local ()
Tests whether @address is a link-local address (that is, if it identifies a host on a local network that is not connected to the Internet).
%TRUE if @address is a link-local address..get_is_loopback ()
Tests whether @address is the loopback address for its family.
%TRUE if @address is the loopback address for its family..get_is_mc_global ()
Tests whether @address is a global multicast address.
%TRUE if @address is a global multicast address..get_is_mc_link_local ()
Tests whether @address is a link-local multicast address.
%TRUE if @address is a link-local multicast address..get_is_mc_node_local ()
Tests whether @address is a node-local multicast address.
%TRUE if @address is a node-local multicast address..get_is_mc_org_local ()
Tests whether @address is an organization-local multicast address.
%TRUE if @address is an organization-local multicast address..get_is_mc_site_local ()
Tests whether @address is a site-local multicast address.
%TRUE if @address is a site-local multicast address..get_is_multicast ()
Tests whether @address is a multicast address.
%TRUE if @address is a multicast address..get_is_site_local ()
Tests whether @address is a site-local address such as 10.0.0.1 (that is, the address identifies a host on a local network that can not be reached directly from the Internet, but which may have outgoing Internet connectivity via a NAT or firewall).
%TRUE if @address is a site-local address..get_native_size ()
Gets the size of the native raw binary address for @address. This is the size of the data that you get from g_inet_address_to_bytes().
the number of bytes used for the native version of @address..get_scope_id ()
Gets the value of [property@Gio.InetAddress:scope-id].
The scope-id for the address, 0 if unset or not IPv6 address..to_bytes ()
Gets the raw binary address data from @address.
a pointer to an internal array of the bytes in @address, which should not be modified, stored, or freed. The size of this array can be gotten with g_inet_address_get_native_size()..to_string ()
Converts @address to string form.
a representation of @address as a string, which should be freed after use..[361:14] static extends: object
Generated metadata helpers for InetAddress class surfaces.
properties ()
Returns property metadata for
InetAddress.
A list.[292:14] static extends: object
Alternate constructors for GInetAddress. Usage:
GInetAddressCtors.<name>(...). The primary constructor lives
directly on GInetAddress.
newFromBytes (list bytes, string family)
Creates a new #GInetAddress from the given @family and @bytes. @bytes should be 4 bytes for %G_SOCKET_FAMILY_IPV4 and 16 bytes for %G_SOCKET_FAMILY_IPV6.
bytes is raw address data.family is the address family of @bytes.A new GInetAddress.newFromBytesWithIpv6Info (list bytes, string family, int flowinfo, int scope_id)
Creates a new [class@Gio.InetAddress] from the given @family, @bytes and
@bytes must be 4 bytes for [enum@Gio.SocketFamily.IPV4] and 16 bytes for [enum@Gio.SocketFamily.IPV6].bytes is raw address data.family is the address family of @bytes.scope_id is the scope-id of the address.A new GInetAddress.newFromString (string arg0String)
Parses @string as an IP address and creates a new #GInetAddress. If
is an IPv6 address, it can also contain a scope ID (separated from the address by a %). Note that currently this behavior is platform specific. This may change in a future release.string is a string representation of an IP address.A new GInetAddress.newLoopback (string family)
Creates a #GInetAddress for the loopback address for @family.
family is the address family.A new GInetAddress.
Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.