Gio.InetAddress¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/co |
|||
r/w/co |
|||
r |
|||
r |
|||
r |
|||
r |
|||
r |
|||
r |
|||
r |
|||
r |
|||
r |
|||
r |
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Gio.InetAddress(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
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 theGInetAddress
for a hostname. Use [method`Gio`.Resolver.lookup_by_address] or [method`Gio`.Resolver.lookup_by_address_async] to look up the hostname for aGInetAddress
.To actually connect to a remote host, you will need a [class`Gio`.InetSocketAddress] (which includes a
GInetAddress
as well as a port number).- classmethod new_any(family)[source]¶
- Parameters:
family (
Gio.SocketFamily
) – the address family- Returns:
a new
Gio.InetAddress
corresponding to the “any” address for family. Free the returned object withGObject.Object.unref
().- Return type:
Creates a
Gio.InetAddress
for the “any” address (unassigned/”don’t care”) for family.New in version 2.22.
- classmethod new_from_bytes(bytes, family)[source]¶
- Parameters:
bytes (
bytes
) – raw address datafamily (
Gio.SocketFamily
) – the address family of bytes
- Returns:
a new
Gio.InetAddress
corresponding to family and bytes. Free the returned object withGObject.Object.unref
().- Return type:
Creates a new
Gio.InetAddress
from the given family and bytes. bytes should be 4 bytes forGio.SocketFamily.IPV4
and 16 bytes forGio.SocketFamily.IPV6
.New in version 2.22.
- classmethod new_from_string(string)[source]¶
- Parameters:
string (
str
) – a string representation of an IP address- Returns:
a new
Gio.InetAddress
corresponding to string, orNone
if string could not be parsed. Free the returned object withGObject.Object.unref
().- Return type:
Parses string as an IP address and creates a new
Gio.InetAddress
.New in version 2.22.
- classmethod new_loopback(family)[source]¶
- Parameters:
family (
Gio.SocketFamily
) – the address family- Returns:
a new
Gio.InetAddress
corresponding to the loopback address for family. Free the returned object withGObject.Object.unref
().- Return type:
Creates a
Gio.InetAddress
for the loopback address for family.New in version 2.22.
- equal(other_address)[source]¶
- Parameters:
other_address (
Gio.InetAddress
) – AnotherGio.InetAddress
.- Returns:
- Return type:
Checks if two
Gio.InetAddress
instances are equal, e.g. the same address.New in version 2.30.
- get_is_link_local()[source]¶
-
Tests whether self is a link-local address (that is, if it identifies a host on a local network that is not connected to the Internet).
New in version 2.22.
- get_is_loopback()[source]¶
-
Tests whether self is the loopback address for its family.
New in version 2.22.
- get_is_mc_link_local()[source]¶
-
Tests whether self is a link-local multicast address.
New in version 2.22.
- get_is_mc_node_local()[source]¶
-
Tests whether self is a node-local multicast address.
New in version 2.22.
- get_is_mc_org_local()[source]¶
-
Tests whether self is an organization-local multicast address.
New in version 2.22.
- get_is_mc_site_local()[source]¶
-
Tests whether self is a site-local multicast address.
New in version 2.22.
- get_is_site_local()[source]¶
-
Tests whether self 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).
New in version 2.22.
- get_native_size()[source]¶
- Returns:
the number of bytes used for the native version of self.
- Return type:
Gets the size of the native raw binary address for self. This is the size of the data that you get from g_inet_address_to_bytes().
New in version 2.22.
Property Details¶
- Gio.InetAddress.props.bytes¶
- Name:
bytes
- Type:
- Default Value:
- Flags:
The raw address data.
New in version 2.22.
- Gio.InetAddress.props.family¶
- Name:
family
- Type:
- Default Value:
- Flags:
The address family (IPv4 or IPv6).
New in version 2.22.
- Gio.InetAddress.props.is_any¶
-
Whether this is the “any” address for its family. See
Gio.InetAddress.get_is_any
().New in version 2.22.
- Gio.InetAddress.props.is_link_local¶
-
Whether this is a link-local address. See
Gio.InetAddress.get_is_link_local
().New in version 2.22.
- Gio.InetAddress.props.is_loopback¶
-
Whether this is the loopback address for its family. See
Gio.InetAddress.get_is_loopback
().New in version 2.22.
- Gio.InetAddress.props.is_mc_global¶
-
Whether this is a global multicast address. See
Gio.InetAddress.get_is_mc_global
().New in version 2.22.
- Gio.InetAddress.props.is_mc_link_local¶
-
Whether this is a link-local multicast address. See
Gio.InetAddress.get_is_mc_link_local
().New in version 2.22.
- Gio.InetAddress.props.is_mc_node_local¶
-
Whether this is a node-local multicast address. See
Gio.InetAddress.get_is_mc_node_local
().New in version 2.22.
- Gio.InetAddress.props.is_mc_org_local¶
-
Whether this is an organization-local multicast address. See
Gio.InetAddress.get_is_mc_org_local
().New in version 2.22.
- Gio.InetAddress.props.is_mc_site_local¶
-
Whether this is a site-local multicast address. See
Gio.InetAddress.get_is_mc_site_local
().New in version 2.22.
- Gio.InetAddress.props.is_multicast¶
-
Whether this is a multicast address. See
Gio.InetAddress.get_is_multicast
().New in version 2.22.
- Gio.InetAddress.props.is_site_local¶
-
Whether this is a site-local address. See
Gio.InetAddress.get_is_loopback
().New in version 2.22.