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.ObjectAbstract: No Structure: Gio.InetAddressClassGio.InetAddressrepresents an IPv4 or IPv6 internet address. UseGio.Resolver.lookup_by_name() orGio.Resolver.lookup_by_name_async() to look up theGio.InetAddressfor a hostname. UseGio.Resolver.lookup_by_address() orGio.Resolver.lookup_by_address_async() to look up the hostname for aGio.InetAddress.To actually connect to a remote host, you will need a
Gio.InetSocketAddress(which includes aGio.InetAddressas well as a port number).-
classmethod
new_any(family)[source]¶ Parameters: family ( Gio.SocketFamily) – the address familyReturns: a new Gio.InetAddresscorresponding to the “any” address for family. Free the returned object withGObject.Object.unref().Return type: Gio.InetAddressCreates 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 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.
- bytes (
-
classmethod
new_from_string(string)[source]¶ Parameters: string ( str) – a string representation of an IP addressReturns: a new Gio.InetAddresscorresponding to string, orNoneif string could not be parsed. Free the returned object withGObject.Object.unref().Return type: Gio.InetAddressorNoneParses 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 familyReturns: a new Gio.InetAddresscorresponding to the loopback address for family. Free the returned object withGObject.Object.unref().Return type: Gio.InetAddressCreates 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: Trueif self and other_address are equal,Falseotherwise.Return type: boolChecks 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.SocketFamilyGets self’s family
New in version 2.22.
-
get_is_any()[source]¶ Returns: Trueif self is the “any” address for its family.Return type: boolTests 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: boolTests 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: boolTests 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: boolTests 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: boolTests 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: boolTests 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: boolTests 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: boolTests 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: boolTests 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: boolTests 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: intGets 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: bytesType: intDefault Value: NoneFlags: READABLE,WRITABLE,CONSTRUCT_ONLYThe raw address data
-
Gio.InetAddress.props.family¶ Name: familyType: Gio.SocketFamilyDefault Value: Gio.SocketFamily.INVALIDFlags: READABLE,WRITABLE,CONSTRUCT_ONLYThe address family (IPv4 or IPv6)
-
Gio.InetAddress.props.is_any¶ Name: is-anyType: boolDefault Value: FalseFlags: READABLEWhether 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-localType: boolDefault Value: FalseFlags: READABLEWhether 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-loopbackType: boolDefault Value: FalseFlags: READABLEWhether 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-globalType: boolDefault Value: FalseFlags: READABLEWhether 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-localType: boolDefault Value: FalseFlags: READABLEWhether 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-localType: boolDefault Value: FalseFlags: READABLEWhether 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-localType: boolDefault Value: FalseFlags: READABLEWhether 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-localType: boolDefault Value: FalseFlags: READABLEWhether 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-multicastType: boolDefault Value: FalseFlags: READABLEWhether 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-localType: boolDefault Value: FalseFlags: READABLEWhether this is a site-local address. See
Gio.InetAddress.get_is_loopback().New in version 2.22.