Class: Gio::InetAddress

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Instance Method Summary collapse

Instance Method Details

#bytesGObject

Returns bytes.

Returns:

  • (GObject)

    bytes

#bytes=(bytes) ⇒ GObject

Parameters:

  • bytes (GObject)

Returns:

  • (GObject)

    bytes

  • (GObject)

    bytes

#equal(other_address) ⇒ TrueClass

Checks if two GInet::Address instances are equal, e.g. the same address.

Parameters:

Returns:

  • (TrueClass)

    true if address and other_address are equal, false otherwise.

#familyGio::SocketFamily

Returns family.

Returns:

#family=(family) ⇒ Gio::SocketFamily

Parameters:

Returns:

#is_anyTrueClass

Tests whether address is the “any” address for its family.

Returns:

  • (TrueClass)

    true if address is the “any” address for its family.

#is_any=(is_any) ⇒ TrueClass

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

Parameters:

  • is_any (TrueClass)

Returns:

  • (TrueClass)

    is-any

  • (TrueClass)

    is-any

#is_any?TrueClass

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

Returns:

  • (TrueClass)

    is-any

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

Returns:

  • (TrueClass)

    true if address is a link-local address.

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

Parameters:

  • is_link_local (TrueClass)

Returns:

  • (TrueClass)

    is-link-local

  • (TrueClass)

    is-link-local

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

Returns:

  • (TrueClass)

    is-link-local

#is_loopbackTrueClass

Tests whether address is the loopback address for its family.

Returns:

  • (TrueClass)

    true if address is the loopback address for its family.

#is_loopback=(is_loopback) ⇒ TrueClass

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

Parameters:

  • is_loopback (TrueClass)

Returns:

  • (TrueClass)

    is-loopback

  • (TrueClass)

    is-loopback

#is_loopback?TrueClass

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

Returns:

  • (TrueClass)

    is-loopback

#is_mc_globalTrueClass

Tests whether address is a global multicast address.

Returns:

  • (TrueClass)

    true if address is a global multicast address.

#is_mc_global=(is_mc_global) ⇒ TrueClass

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

Parameters:

  • is_mc_global (TrueClass)

Returns:

  • (TrueClass)

    is-mc-global

  • (TrueClass)

    is-mc-global

#is_mc_global?TrueClass

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

Returns:

  • (TrueClass)

    is-mc-global

Tests whether address is a link-local multicast address.

Returns:

  • (TrueClass)

    true if address is a link-local multicast address.

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

Parameters:

  • is_mc_link_local (TrueClass)

Returns:

  • (TrueClass)

    is-mc-link-local

  • (TrueClass)

    is-mc-link-local

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

Returns:

  • (TrueClass)

    is-mc-link-local

#is_mc_node_localTrueClass

Tests whether address is a node-local multicast address.

Returns:

  • (TrueClass)

    true if address is a node-local multicast address.

#is_mc_node_local=(is_mc_node_local) ⇒ TrueClass

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

Parameters:

  • is_mc_node_local (TrueClass)

Returns:

  • (TrueClass)

    is-mc-node-local

  • (TrueClass)

    is-mc-node-local

#is_mc_node_local?TrueClass

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

Returns:

  • (TrueClass)

    is-mc-node-local

#is_mc_org_localTrueClass

Tests whether address is an organization-local multicast address.

Returns:

  • (TrueClass)

    true if address is an organization-local multicast address.

#is_mc_org_local=(is_mc_org_local) ⇒ TrueClass

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

Parameters:

  • is_mc_org_local (TrueClass)

Returns:

  • (TrueClass)

    is-mc-org-local

  • (TrueClass)

    is-mc-org-local

#is_mc_org_local?TrueClass

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

Returns:

  • (TrueClass)

    is-mc-org-local

#is_mc_site_localTrueClass

Tests whether address is a site-local multicast address.

Returns:

  • (TrueClass)

    true if address is a site-local multicast address.

#is_mc_site_local=(is_mc_site_local) ⇒ TrueClass

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

Parameters:

  • is_mc_site_local (TrueClass)

Returns:

  • (TrueClass)

    is-mc-site-local

  • (TrueClass)

    is-mc-site-local

#is_mc_site_local?TrueClass

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

Returns:

  • (TrueClass)

    is-mc-site-local

#is_multicastTrueClass

Tests whether address is a multicast address.

Returns:

  • (TrueClass)

    true if address is a multicast address.

#is_multicast=(is_multicast) ⇒ TrueClass

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

Parameters:

  • is_multicast (TrueClass)

Returns:

  • (TrueClass)

    is-multicast

  • (TrueClass)

    is-multicast

#is_multicast?TrueClass

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

Returns:

  • (TrueClass)

    is-multicast

#is_site_localTrueClass

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

Returns:

  • (TrueClass)

    true if address is a site-local address.

#is_site_local=(is_site_local) ⇒ TrueClass

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

Parameters:

  • is_site_local (TrueClass)

Returns:

  • (TrueClass)

    is-site-local

  • (TrueClass)

    is-site-local

#is_site_local?TrueClass

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

Returns:

  • (TrueClass)

    is-site-local

#native_sizeInteger

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

Returns:

  • (Integer)

    the number of bytes used for the native version of address.

#new_any(family) ⇒ Gio::InetAddress

Creates a GInet::Address for the “any” address (unassigned/“don’t care”) for family. for family.

Free the returned object with g_object_unref().

Parameters:

Returns:

  • (Gio::InetAddress)

    a new GInet::Address corresponding to the “any” address

#new_from_bytes(bytes, family) ⇒ Gio::InetAddress

Creates a new GInet::Address from the given family and bytes. bytes should be 4 bytes for %G_SOCKET_FAMILY_IPV4 and 16 bytes for %G_SOCKET_FAMILY_IPV6.

Parameters:

  • bytes (Array<Integer>)

    raw address data

  • family (Gio::SocketFamily)

    the address family of bytes

Returns:

  • (Gio::InetAddress)

    a new GInet::Address corresponding to family and bytes. Free the returned object with g_object_unref().

#new_from_string(string) ⇒ Gio::InetAddress

Parses string as an IP address and creates a new GInet::Address. string could not be parsed.

Free the returned object with g_object_unref().

Parameters:

  • string (String)

    a string representation of an IP address

Returns:

  • (Gio::InetAddress)

    a new GInet::Address corresponding to string, or nil if

#new_loopback(family) ⇒ Gio::InetAddress

Creates a GInet::Address for the loopback address for family. for family.

Free the returned object with g_object_unref().

Parameters:

Returns:

  • (Gio::InetAddress)

    a new GInet::Address corresponding to the loopback address

#to_bytesInteger

Gets the raw binary address data from address. which should not be modified, stored, or freed. The size of this array can be gotten with g_inet_address_get_native_size().

Returns:

  • (Integer)

    a pointer to an internal array of the bytes in address,

#to_stringString

Converts address to string form. freed after use.

Returns:

  • (String)

    a representation of address as a string, which should be