Gio.InetAddress¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
Properties¶
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r/w/co |
|||
r/w/co |
|||
r/w/co |
|||
r |
|||
r |
|||
r |
|||
r |
|||
r |
|||
r |
|||
r |
|||
r |
|||
r |
|||
r |
|||
r/w/co |
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
|---|---|---|---|
parent_instance |
r |
Class Details¶
- class Gio.InetAddress(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
GInetAddressrepresents an IPv4 or IPv6 internet address. Use [method`Gio`.Resolver.lookup_by_name] or [method`Gio`.Resolver.lookup_by_name_async] to look up theGInetAddressfor 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
GInetAddressas well as a port number).- classmethod new_any(family)[source]¶
- Parameters:
family (
Gio.SocketFamily) – the address family- Returns:
a new
Gio.InetAddresscorresponding to the “any” address for family. Free the returned object withGObject.Object.unref().- Return type:
Creates a
Gio.InetAddressfor 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.InetAddresscorresponding to family and bytes. Free the returned object withGObject.Object.unref().- Return type:
Creates a new
Gio.InetAddressfrom the given family and bytes. bytes should be 4 bytes forGio.SocketFamily.IPV4and 16 bytes forGio.SocketFamily.IPV6.New in version 2.22.
- classmethod new_from_bytes_with_ipv6_info(bytes, family, flowinfo, scope_id)[source]¶
- Parameters:
bytes (
bytes) – raw address datafamily (
Gio.SocketFamily) – the address family of bytesflowinfo (
int) –scope_id (
int) – the scope-id of the address
- Returns:
a new internet address corresponding to family, bytes and scope_id
- Return type:
Creates a new [class`Gio`.InetAddress] from the given family, bytes and scope_id.
bytes must be 4 bytes for [enum`Gio`.SocketFamily.IPV4] and 16 bytes for [enum`Gio`.SocketFamily.IPV6].
New in version 2.86.
- classmethod new_from_string(string)[source]¶
- Parameters:
string (
str) – a string representation of an IP address- Returns:
a new
Gio.InetAddresscorresponding to string, orNoneif 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.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.New in version 2.22.
- classmethod new_loopback(family)[source]¶
- Parameters:
family (
Gio.SocketFamily) – the address family- Returns:
a new
Gio.InetAddresscorresponding to the loopback address for family. Free the returned object withGObject.Object.unref().- Return type:
Creates a
Gio.InetAddressfor 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.InetAddressinstances are equal, e.g. the same address.New in version 2.30.
- get_flowinfo()[source]¶
- Returns:
The flowinfo for the address,
0if unset or not IPv6 address.- Return type:
Gets the value of [property`Gio`.InetAddress:flowinfo].
New in version 2.86.
- 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.
- get_scope_id()[source]¶
- Returns:
The scope-id for the address,
0if unset or not IPv6 address.- Return type:
Gets the value of [property`Gio`.InetAddress:scope-id].
New in version 2.86.
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.flowinfo¶
- Name:
flowinfo- Type:
- Default Value:
0- Flags:
The flowinfo for an IPv6 address. See [method`Gio`.InetAddress.get_flowinfo].
New in version 2.86.
- 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.
- Gio.InetAddress.props.scope_id¶
- Name:
scope-id- Type:
- Default Value:
0- Flags:
The scope-id for an IPv6 address. See [method`Gio`.InetAddress.get_scope_id].
New in version 2.86.