Class: Gio::InetAddress

Inherits:
Object
  • Object
show all
Defined in:
lib/gio2/inet-address.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(family) ⇒ Gio::InetAddress

Creates a GInet::Address for the loopback address for family. for family. Free the returned object with g_object_unref().

Parameters:

Class Method Details

.any(family) ⇒ Object



20
21
22
23
24
# File 'lib/gio2/inet-address.rb', line 20

def any(family)
  address = allocate
  address.__send__(:initialize_new_any, family)
  address
end

.loopback(family) ⇒ Object



26
27
28
29
30
# File 'lib/gio2/inet-address.rb', line 26

def loopback(family)
  address = allocate
  address.__send__(:initialize_new_loopback, family)
  address
end

Instance Method Details

#bytesGObject

The raw address data.

Returns:

  • (GObject)

    bytes

#bytes=(bytes) ⇒ GObject

The raw address data.

Parameters:

  • bytes (GObject)

Returns:

  • (GObject)

    bytes

  • (GObject)

    bytes

#equal(other_address) ⇒ Boolean

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

Parameters:

Returns:

  • (Boolean)

    true if address and other_address are equal, false otherwise.

#familyGio::SocketFamily

The address family (IPv4 or IPv6).

Returns:

#family=(family) ⇒ Gio::SocketFamily

The address family (IPv4 or IPv6).

Parameters:

Returns:

#is_anyBoolean

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

Returns:

  • (Boolean)

    true if address is the "any" address for its family.

#is_any=(is_any) ⇒ Boolean

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

Parameters:

  • is_any (Boolean)

Returns:

  • (Boolean)

    is-any

  • (Boolean)

    is-any

#is_any?Boolean

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

Returns:

  • (Boolean)

    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:

  • (Boolean)

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

Returns:

  • (Boolean)

    is-link-local

  • (Boolean)

    is-link-local

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

Returns:

  • (Boolean)

    is-link-local

#is_loopbackBoolean

Tests whether address is the loopback address for its family.

Returns:

  • (Boolean)

    true if address is the loopback address for its family.

#is_loopback=(is_loopback) ⇒ Boolean

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

Parameters:

  • is_loopback (Boolean)

Returns:

  • (Boolean)

    is-loopback

  • (Boolean)

    is-loopback

#is_loopback?Boolean

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

Returns:

  • (Boolean)

    is-loopback

#is_mc_globalBoolean

Tests whether address is a global multicast address.

Returns:

  • (Boolean)

    true if address is a global multicast address.

#is_mc_global=(is_mc_global) ⇒ Boolean

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

Parameters:

  • is_mc_global (Boolean)

Returns:

  • (Boolean)

    is-mc-global

  • (Boolean)

    is-mc-global

#is_mc_global?Boolean

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

Returns:

  • (Boolean)

    is-mc-global

Tests whether address is a link-local multicast address.

Returns:

  • (Boolean)

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

Returns:

  • (Boolean)

    is-mc-link-local

  • (Boolean)

    is-mc-link-local

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

Returns:

  • (Boolean)

    is-mc-link-local

#is_mc_node_localBoolean

Tests whether address is a node-local multicast address.

Returns:

  • (Boolean)

    true if address is a node-local multicast address.

#is_mc_node_local=(is_mc_node_local) ⇒ Boolean

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

Parameters:

  • is_mc_node_local (Boolean)

Returns:

  • (Boolean)

    is-mc-node-local

  • (Boolean)

    is-mc-node-local

#is_mc_node_local?Boolean

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

Returns:

  • (Boolean)

    is-mc-node-local

#is_mc_org_localBoolean

Tests whether address is an organization-local multicast address.

Returns:

  • (Boolean)

    true if address is an organization-local multicast address.

#is_mc_org_local=(is_mc_org_local) ⇒ Boolean

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

Parameters:

  • is_mc_org_local (Boolean)

Returns:

  • (Boolean)

    is-mc-org-local

  • (Boolean)

    is-mc-org-local

#is_mc_org_local?Boolean

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

Returns:

  • (Boolean)

    is-mc-org-local

#is_mc_site_localBoolean

Tests whether address is a site-local multicast address.

Returns:

  • (Boolean)

    true if address is a site-local multicast address.

#is_mc_site_local=(is_mc_site_local) ⇒ Boolean

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

Parameters:

  • is_mc_site_local (Boolean)

Returns:

  • (Boolean)

    is-mc-site-local

  • (Boolean)

    is-mc-site-local

#is_mc_site_local?Boolean

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

Returns:

  • (Boolean)

    is-mc-site-local

#is_multicastBoolean

Tests whether address is a multicast address.

Returns:

  • (Boolean)

    true if address is a multicast address.

#is_multicast=(is_multicast) ⇒ Boolean

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

Parameters:

  • is_multicast (Boolean)

Returns:

  • (Boolean)

    is-multicast

  • (Boolean)

    is-multicast

#is_multicast?Boolean

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

Returns:

  • (Boolean)

    is-multicast

#is_site_localBoolean

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:

  • (Boolean)

    true if address is a site-local address.

#is_site_local=(is_site_local) ⇒ Boolean

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

Parameters:

  • is_site_local (Boolean)

Returns:

  • (Boolean)

    is-site-local

  • (Boolean)

    is-site-local

#is_site_local?Boolean

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

Returns:

  • (Boolean)

    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.

#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