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 _getGType() static nothrow
GType _gType() @property nothrow
InetAddress self() nothrowReturns `this`, for use in `with` statements.
InetAddressGidBuilder builder() static nothrowGet builder for [gio.inet_address.InetAddress] Returns: New builder object
void * bytes() @property nothrowGet `bytes` property. Returns: The raw address data.
gio.types.SocketFamily family() @property nothrowGet `family` property. Returns: The address family (IPv4 or IPv6).
bool isAny() @property nothrowGet `isAny` property. Returns: Whether this is the "any" address for its family. See [gio.inet_address.InetAddress.getIsAny].
bool isLinkLocal() @property nothrowGet `isLinkLocal` property. Returns: Whether this is a link-local address. See [gio.inet_address.InetAddress.getIsLinkLocal].
bool isLoopback() @property nothrowGet `isLoopback` property. Returns: Whether this is the loopback address for its family. See [gio.inet_address.InetAddress.getIsLoopback].
bool isMcGlobal() @property nothrowGet `isMcGlobal` property. Returns: Whether this is a global multicast address. See [gio.inet_address.InetAddress.getIsMcGlobal].
bool isMcLinkLocal() @property nothrowGet `isMcLinkLocal` property. Returns: Whether this is a link-local multicast address. See [gio.inet_address.InetAddress.getIsMcLinkLocal].
bool isMcNodeLocal() @property nothrowGet `isMcNodeLocal` property. Returns: Whether this is a node-local multicast address. See [gio.inet_address.InetAddress.getIsMcNodeLocal].
bool isMcOrgLocal() @property nothrowGet `isMcOrgLocal` property. Returns: Whether this is an organization-local multicast address. See [gio.inet_address.InetAddress.getIsMcOrgLocal].
bool isMcSiteLocal() @property nothrowGet `isMcSiteLocal` property. Returns: Whether this is a site-local multicast address. See [gio.inet_address.InetAddress.getIsMcSiteLocal].
bool isMulticast() @property nothrowGet `isMulticast` property. Returns: Whether this is a multicast address. See [gio.inet_address.InetAddress.getIsMulticast].
bool isSiteLocal() @property nothrowGet `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) static nothrowCreates a #GInetAddress for the "any" address (unassigned/"don't care") for family.
gio.inet_address.InetAddress newFromBytes(ubyte[] bytes, gio.types.SocketFamily family) static nothrowCreates 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_) static nothrowParses string as an IP address and creates a new #GInetAddress.
gio.inet_address.InetAddress newLoopback(gio.types.SocketFamily family) static nothrowCreates a #GInetAddress for the loopback address for family.
bool equal(gio.inet_address.InetAddress otherAddress) nothrowChecks if two #GInetAddress instances are equal, e.g. the same address.
gio.types.SocketFamily getFamily() nothrowGets address's family Returns: address's family
bool getIsAny() nothrowTests whether address is the "any" address for its family. Returns: true if address is the "any" address for its family.
bool getIsLinkLocal() nothrowTests 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() nothrowTests whether address is the loopback address for its family. Returns: true if address is the loopback address for its family.
bool getIsMcGlobal() nothrowTests whether address is a global multicast address. Returns: true if address is a global multicast address.
bool getIsMcLinkLocal() nothrowTests whether address is a link-local multicast address. Returns: true if address is a link-local multicast address.
bool getIsMcNodeLocal() nothrowTests whether address is a node-local multicast address. Returns: true if address is a node-local multicast address.
bool getIsMcOrgLocal() nothrowTests whether address is an organization-local multicast address. Returns: true if address is an organization-local multicast address.
bool getIsMcSiteLocal() nothrowTests whether address is a site-local multicast address. Returns: true if address is a site-local multicast address.
bool getIsMulticast() nothrowTests whether address is a multicast address. Returns: true if address is a multicast address.
bool getIsSiteLocal() nothrowTests 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() nothrowGets 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_() nothrowConverts 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)

Fluent builder implementation template for gio.inet_address.InetAddress

Methods
T bytes(void * propval) nothrowSet `bytes` property. Params: propval = The raw address data. Returns: Builder instance for fluent chaining
T family(gio.types.SocketFamily propval) nothrowSet `family` property. Params: propval = The address family (IPv4 or IPv6). Returns: Builder instance for fluent chaining

Fluent builder for gio.inet_address.InetAddress

Methods
InetAddress build() nothrowCreate object from builder. Returns: New object