Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: InetAddress

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

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • InetAddress (family = null)

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

    • @p 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 exposing handle(), or null. Returns null when the argument carries no pointer.

    • @p Source is the raw handle, raw buffer, wrapper, or null.
    • @r A raw pointer carrier or null when no pointer is present.
  • getLib ()

    Returns the opened native library for this generated wrapper.

    • @r The opened native library.
  • handle ()

    Returns the wrapped NativeHandle.

    • @r The wrapped NativeHandle.
  • isNull ()

    Returns true when the wrapped handle is null.

    • @r A bool.
  • describe ()

    Returns a small string for debugging generated wrappers.

    • @r A string.
  • asObject ()

    Wraps this handle as Object.

    • @r A Object object.
  • equal (object other_address)

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

    • @p other_address is Another #GInetAddress..
  • get_family ()

    Gets @address's family

  • get_is_any ()

    Tests whether @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).

  • get_is_loopback ()

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

  • get_is_mc_global ()

    Tests whether @address is a global multicast address.

  • get_is_mc_link_local ()

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

  • get_is_mc_node_local ()

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

  • get_is_mc_org_local ()

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

  • get_is_mc_site_local ()

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

  • get_is_multicast ()

    Tests whether @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).

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

  • to_string ()

    Converts @address to string form.

class: InetAddressMeta

[282:14] static extends: object

Generated metadata helpers for InetAddress class surfaces.

Methods

  • properties ()

    Returns property metadata for InetAddress.

    • @r A list.

class: InetAddressCtors

[248:14] static extends: object

Alternate constructors for InetAddress. Usage: InetAddressCtors.<name>(...). The primary constructor lives directly on InetAddress.

Methods

  • newFromString (string arg0String)

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

    • @address 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.
    • @p string is a string representation of an IP address.
    • @r A new InetAddress.
  • newLoopback (string family)

    Creates a #GInetAddress for the loopback address for @family.

    • @p family is the address family.
    • @r A new InetAddress.