Gio.InetAddress¶
| Subclasses: | None | 
|---|
Methods¶
| Inherited: | GObject.Object (37) | 
|---|---|
| Structs: | GObject.ObjectClass (5) | 
| class | new_any(family) | 
| class | new_from_bytes(bytes, family) | 
| class | new_from_string(string) | 
| class | new_loopback(family) | 
| equal(other_address) | |
| get_family() | |
| get_is_any() | |
| get_is_link_local() | |
| get_is_loopback() | |
| get_is_mc_global() | |
| get_is_mc_link_local() | |
| get_is_mc_node_local() | |
| get_is_mc_org_local() | |
| get_is_mc_site_local() | |
| get_is_multicast() | |
| get_is_site_local() | |
| get_native_size() | |
| to_string() | 
Properties¶
| Name | Type | Flags | Short Description | 
|---|---|---|---|
| bytes | int | r/w/co | The raw address data | 
| family | Gio.SocketFamily | r/w/co | The address family (IPv4 or IPv6) | 
| is-any | bool | r | Whether this is the “any” address for its family | 
| is-link-local | bool | r | Whether this is a link-local address | 
| is-loopback | bool | r | Whether this is the loopback address for its family | 
| is-mc-global | bool | r | Whether this is a global multicast address | 
| is-mc-link-local | bool | r | Whether this is a link-local multicast address | 
| is-mc-node-local | bool | r | Whether this is a node-local multicast address | 
| is-mc-org-local | bool | r | Whether this is an organization-local multicast address | 
| is-mc-site-local | bool | r | Whether this is a site-local multicast address | 
| is-multicast | bool | r | Whether this is a multicast address | 
| is-site-local | bool | r | Whether this is a site-local address | 
Signals¶
| Inherited: | GObject.Object (1) | 
|---|
Class Details¶
- 
class Gio.InetAddress(**kwargs)¶
- Bases: - GObject.Object- Abstract: - No - Structure: - Gio.InetAddressClass- Gio.InetAddressrepresents an IPv4 or IPv6 internet address. Use- Gio.Resolver.lookup_by_name() or- Gio.Resolver.lookup_by_name_async() to look up the- Gio.InetAddressfor a hostname. Use- Gio.Resolver.lookup_by_address() or- Gio.Resolver.lookup_by_address_async() to look up the hostname for a- Gio.InetAddress.- To actually connect to a remote host, you will need a - Gio.InetSocketAddress(which includes a- Gio.InetAddressas 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 with- GObject.Object.unref().- Return type: - Gio.InetAddress- 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 data
- family (Gio.SocketFamily) – the address family of bytes
 - Returns: - a new - Gio.InetAddresscorresponding to family and bytes. Free the returned object with- GObject.Object.unref().- Return type: - Creates a new - Gio.InetAddressfrom the given family and bytes. bytes should be 4 bytes for- Gio.SocketFamily.IPV4and 16 bytes for- Gio.SocketFamily.IPV6.- New in version 2.22. 
- bytes (
 - 
classmethod new_from_string(string)[source]¶
- Parameters: - string ( - str) – a string representation of an IP address- Returns: - a new - Gio.InetAddresscorresponding to string, or- Noneif string could not be parsed. Free the returned object with- GObject.Object.unref().- Return type: - Gio.InetAddressor- None- 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.InetAddresscorresponding to the loopback address for family. Free the returned object with- GObject.Object.unref().- Return type: - Gio.InetAddress- Creates a - Gio.InetAddressfor the loopback address for family.- New in version 2.22. 
 - 
equal(other_address)[source]¶
- Parameters: - other_address ( - Gio.InetAddress) – Another- Gio.InetAddress.- Returns: - Trueif self and other_address are equal,- Falseotherwise.- Return type: - bool- Checks if two - Gio.InetAddressinstances are equal, e.g. the same address.- New in version 2.30. 
 - 
get_family()[source]¶
- Returns: - self’s family - Return type: - Gio.SocketFamily- Gets self’s family - New in version 2.22. 
 - 
get_is_any()[source]¶
- Returns: - Trueif self is the “any” address for its family.- Return type: - bool- Tests whether self is the “any” address for its family. - New in version 2.22. 
 - 
get_is_link_local()[source]¶
- Returns: - Trueif self is a link-local address.- Return type: - bool- 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]¶
- Returns: - Trueif self is the loopback address for its family.- Return type: - bool- Tests whether self is the loopback address for its family. - New in version 2.22. 
 - 
get_is_mc_global()[source]¶
- Returns: - Trueif self is a global multicast address.- Return type: - bool- Tests whether self is a global multicast address. - New in version 2.22. 
 - 
get_is_mc_link_local()[source]¶
- Returns: - Trueif self is a link-local multicast address.- Return type: - bool- Tests whether self is a link-local multicast address. - New in version 2.22. 
 - 
get_is_mc_node_local()[source]¶
- Returns: - Trueif self is a node-local multicast address.- Return type: - bool- Tests whether self is a node-local multicast address. - New in version 2.22. 
 - 
get_is_mc_org_local()[source]¶
- Returns: - Trueif self is an organization-local multicast address.- Return type: - bool- Tests whether self is an organization-local multicast address. - New in version 2.22. 
 - 
get_is_mc_site_local()[source]¶
- Returns: - Trueif self is a site-local multicast address.- Return type: - bool- Tests whether self is a site-local multicast address. - New in version 2.22. 
 - 
get_is_multicast()[source]¶
- Returns: - Trueif self is a multicast address.- Return type: - bool- Tests whether self is a multicast address. - New in version 2.22. 
 - 
get_is_site_local()[source]¶
- Returns: - Trueif self is a site-local address.- Return type: - bool- 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: - int- 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. 
 
- 
classmethod 
Property Details¶
- 
Gio.InetAddress.props.bytes¶
- Name: - bytes- Type: - int- Default Value: - None- Flags: - READABLE,- WRITABLE,- CONSTRUCT_ONLY- The raw address data 
- 
Gio.InetAddress.props.family¶
- Name: - family- Type: - Gio.SocketFamily- Default Value: - Gio.SocketFamily.INVALID- Flags: - READABLE,- WRITABLE,- CONSTRUCT_ONLY- The address family (IPv4 or IPv6) 
- 
Gio.InetAddress.props.is_any¶
- Name: - is-any- Type: - bool- Default Value: - False- Flags: - READABLE- 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¶
- Name: - is-link-local- Type: - bool- Default Value: - False- Flags: - READABLE- Whether this is a link-local address. See - Gio.InetAddress.get_is_link_local().- New in version 2.22. 
- 
Gio.InetAddress.props.is_loopback¶
- Name: - is-loopback- Type: - bool- Default Value: - False- Flags: - READABLE- 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¶
- Name: - is-mc-global- Type: - bool- Default Value: - False- Flags: - READABLE- 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¶
- Name: - is-mc-link-local- Type: - bool- Default Value: - False- Flags: - READABLE- 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¶
- Name: - is-mc-node-local- Type: - bool- Default Value: - False- Flags: - READABLE- 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¶
- Name: - is-mc-org-local- Type: - bool- Default Value: - False- Flags: - READABLE- 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¶
- Name: - is-mc-site-local- Type: - bool- Default Value: - False- Flags: - READABLE- 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¶
- Name: - is-multicast- Type: - bool- Default Value: - False- Flags: - READABLE- Whether this is a multicast address. See - Gio.InetAddress.get_is_multicast().- New in version 2.22. 
- 
Gio.InetAddress.props.is_site_local¶
- Name: - is-site-local- Type: - bool- Default Value: - False- Flags: - READABLE- Whether this is a site-local address. See - Gio.InetAddress.get_is_loopback().- New in version 2.22.