gio.inet_address

Module for [InetAddress] class

Types 3

[gio.inet_address.InetAddress] represents an IPv4 or IPv6 internet address. Use [gio.resolver.Resolver.lookupByName] or [gio.resolver.Resolver.lookupByNameAsync] to look up the [gio.inet_address.InetAddress] for a hostname. Use [gio.resolver.Resolver.lookupByAddress] or [gio.resolver.Resolver.lookupByAddressAsync] to look up the hostname for a [gio.inet_address.InetAddress].

To actually connect to a remote host, you will need a [gio.inet_socket_address.InetSocketAddress] (which includes a [gio.inet_address.InetAddress] as well as a port number).

Methods
GType _gType() @property
InetAddress self()Returns `this`, for use in `with` statements.
InetAddressGidBuilder builder()Get builder for [gio.inet_address.InetAddress] Returns: New builder object
void * bytes() @propertyGet `bytes` property. Returns: The raw address data.
gio.types.SocketFamily family() @propertyGet `family` property. Returns: The address family (IPv4 or IPv6).
bool isAny() @propertyGet `isAny` property. Returns: Whether this is the "any" address for its family. See [gio.inet_address.InetAddress.getIsAny].
bool isLinkLocal() @propertyGet `isLinkLocal` property. Returns: Whether this is a link-local address. See [gio.inet_address.InetAddress.getIsLinkLocal].
bool isLoopback() @propertyGet `isLoopback` property. Returns: Whether this is the loopback address for its family. See [gio.inet_address.InetAddress.getIsLoopback].
bool isMcGlobal() @propertyGet `isMcGlobal` property. Returns: Whether this is a global multicast address. See [gio.inet_address.InetAddress.getIsMcGlobal].
bool isMcLinkLocal() @propertyGet `isMcLinkLocal` property. Returns: Whether this is a link-local multicast address. See [gio.inet_address.InetAddress.getIsMcLinkLocal].
bool isMcNodeLocal() @propertyGet `isMcNodeLocal` property. Returns: Whether this is a node-local multicast address. See [gio.inet_address.InetAddress.getIsMcNodeLocal].
bool isMcOrgLocal() @propertyGet `isMcOrgLocal` property. Returns: Whether this is an organization-local multicast address. See [gio.inet_address.InetAddress.getIsMcOrgLocal].
bool isMcSiteLocal() @propertyGet `isMcSiteLocal` property. Returns: Whether this is a site-local multicast address. See [gio.inet_address.InetAddress.getIsMcSiteLocal].
bool isMulticast() @propertyGet `isMulticast` property. Returns: Whether this is a multicast address. See [gio.inet_address.InetAddress.getIsMulticast].
bool isSiteLocal() @propertyGet `isSiteLocal` property. Returns: Whether this is a site-local address. See [gio.inet_address.InetAddress.getIsLoopback].
gio.inet_address.InetAddress newAny(gio.types.SocketFamily family)Creates a #GInetAddress for the "any" address (unassigned/"don't care") for family.
gio.inet_address.InetAddress newFromBytes(ubyte[] bytes, gio.types.SocketFamily family)Creates a new #GInetAddress from the given family and bytes. bytes should be 4 bytes for [gio.types.SocketFamily.Ipv4] and 16 bytes for [gio.types.SocketFamily.Ipv6].
gio.inet_address.InetAddress newFromString(string string_)Parses string as an IP address and creates a new #GInetAddress.
gio.inet_address.InetAddress newLoopback(gio.types.SocketFamily family)Creates a #GInetAddress for the loopback address for family.
bool equal(gio.inet_address.InetAddress otherAddress)Checks if two #GInetAddress instances are equal, e.g. the same address.
gio.types.SocketFamily getFamily()Gets address's family Returns: address's family
bool getIsAny()Tests whether address is the "any" address for its family. Returns: true if address is the "any" address for its family.
bool getIsLinkLocal()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: true if address is a link-local address.
bool getIsLoopback()Tests whether address is the loopback address for its family. Returns: true if address is the loopback address for its family.
bool getIsMcGlobal()Tests whether address is a global multicast address. Returns: true if address is a global multicast address.
bool getIsMcLinkLocal()Tests whether address is a link-local multicast address. Returns: true if address is a link-local multicast address.
bool getIsMcNodeLocal()Tests whether address is a node-local multicast address. Returns: true if address is a node-local multicast address.
bool getIsMcOrgLocal()Tests whether address is an organization-local multicast address. Returns: true if address is an organization-local multicast address.
bool getIsMcSiteLocal()Tests whether address is a site-local multicast address. Returns: true if address is a site-local multicast address.
bool getIsMulticast()Tests whether address is a multicast address. Returns: true if address is a multicast address.
bool getIsSiteLocal()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 outg...
size_t getNativeSize()Gets the size of the native raw binary address for address. This is the size of the data that you get from [gio.inet_address.InetAddress.toBytes]. Returns: the number of bytes used for the native v...
string toString_()Converts address to string form. Returns: a representation of address as a string, which should be freed after use.
Constructors
this(void * ptr, Flag!"Take" take)
Methods
T bytes(void * propval)Set `bytes` property. Params: propval = The raw address data. Returns: Builder instance for fluent chaining
T family(gio.types.SocketFamily propval)Set `family` property. Params: propval = The address family (IPv4 or IPv6). Returns: Builder instance for fluent chaining

Fluent builder for [gio.inet_address.InetAddress]