InetAddress

open class InetAddress(pointer: <Error class: unknown class><<Error class: unknown class>>)

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).

Skipped during bindings generation

  • method to_string: C function g_inet_address_to_string is ignored

  • method bytes: Property has no getter nor setter

  • parameter bytes: Array parameter of type guint8 is not supported

Constructors

Link copied to clipboard
constructor(family: SocketFamily)

Creates a #GInetAddress for the "any" address (unassigned/"don't care") for @family.

constructor(string: String)

Parses @string as an IP address and creates a new #GInetAddress.

constructor(pointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The address family (IPv4 or IPv6).

Link copied to clipboard
val gioInetAddressPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open val isAny: Boolean

Whether this is the "any" address for its family. See g_inet_address_get_is_any().

Link copied to clipboard

Whether this is a link-local address. See g_inet_address_get_is_link_local().

Link copied to clipboard

Whether this is the loopback address for its family. See g_inet_address_get_is_loopback().

Link copied to clipboard

Whether this is a global multicast address. See g_inet_address_get_is_mc_global().

Link copied to clipboard

Whether this is a link-local multicast address. See g_inet_address_get_is_mc_link_local().

Link copied to clipboard

Whether this is a node-local multicast address. See g_inet_address_get_is_mc_node_local().

Link copied to clipboard

Whether this is an organization-local multicast address. See g_inet_address_get_is_mc_org_local().

Link copied to clipboard

Whether this is a site-local multicast address. See g_inet_address_get_is_mc_site_local().

Link copied to clipboard

Whether this is a multicast address. See g_inet_address_get_is_multicast().

Link copied to clipboard

Whether this is a site-local address. See g_inet_address_get_is_loopback().

Functions

Link copied to clipboard
open fun equal(otherAddress: InetAddress): Boolean

Checks if two #GInetAddress instances are equal, e.g. the same address.

Link copied to clipboard

Gets @address's family

Link copied to clipboard
open fun getIsAny(): Boolean

Tests whether @address is the "any" address for its family.

Link copied to clipboard

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).

Link copied to clipboard

Tests whether @address is the loopback address for its family.

Link copied to clipboard

Tests whether @address is a global multicast address.

Link copied to clipboard

Tests whether @address is a link-local multicast address.

Link copied to clipboard

Tests whether @address is a node-local multicast address.

Link copied to clipboard

Tests whether @address is an organization-local multicast address.

Link copied to clipboard

Tests whether @address is a site-local multicast address.

Link copied to clipboard

Tests whether @address is a multicast address.

Link copied to clipboard

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).

Link copied to clipboard
open fun getNativeSize(): <Error class: unknown class>

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().