W3cubDocs

/Dart 2

InternetAddress class

An internet address.

This object holds an internet address. If this internet address is the result of a DNS lookup, the address also holds the hostname used to make the lookup. An Internet address combined with a port number represents an endpoint to which a socket can connect or a listening socket can bind.

Constructors

InternetAddress(String address)
factory
Creates a new InternetAddress from a numeric address. [...]

Properties

addressString
read-only
The numeric address of the host. For IPv4 addresses this is using the dotted-decimal notation. For IPv6 it is using the hexadecimal representation.
hostString
read-only
The host used to lookup the address. If there is no host associated with the address this returns the numeric address.
isLinkLocalbool
read-only
Returns true if the InternetAddresss scope is a link-local.
isLoopbackbool
read-only
Returns true if the InternetAddress is a loopback address.
isMulticastbool
read-only
Returns true if the InternetAddresss scope is multicast.
rawAddressList<int>
read-only
Get the raw address of this InternetAddress. The result is either a 4 or 16 byte long list. The returned list is a copy, making it possible to change the list without modifying the InternetAddress.
typeInternetAddressType
read-only
The type of the InternetAddress specified what IP protocol.
hashCodeint
read-only, inherited
The hash code for this object. [...]
runtimeTypeType
read-only, inherited
A representation of the runtime type of the object.

Methods

reverse() → Future<InternetAddress>
Perform a reverse dns lookup on the address, creating a new InternetAddress where the host field set to the result.
noSuchMethod(Invocation invocation) → dynamic
inherited
Invoked when a non-existent method or property is accessed. [...]
toString() → String
inherited
Returns a string representation of this object.

Operators

operator ==(dynamic other) → bool
inherited
The equality operator. [...]

Static Properties

ANY_IP_V4InternetAddress
@Deprecated("Use anyIPv4 instead"), read-only
ANY_IP_V6InternetAddress
@Deprecated("Use anyIPv6 instead"), read-only
anyIPv4InternetAddress
read-only
IP version 4 any address. Use this address when listening on all adapters IP addresses using IP version 4 (IPv4).
anyIPv6InternetAddress
read-only
IP version 6 any address. Use this address when listening on all adapters IP addresses using IP version 6 (IPv6).
LOOPBACK_IP_V4InternetAddress
@Deprecated("Use loopbackIPv4 instead"), read-only
LOOPBACK_IP_V6InternetAddress
@Deprecated("Use loopbackIPv6 instead"), read-only
loopbackIPv4InternetAddress
read-only
IP version 4 loopback address. Use this address when listening on or connecting to the loopback adapter using IP version 4 (IPv4).
loopbackIPv6InternetAddress
read-only
IP version 6 loopback address. Use this address when listening on or connecting to the loopback adapter using IP version 6 (IPv6).

Static Methods

lookup(String host, { InternetAddressType type: InternetAddressType.any }) → Future<List<InternetAddress>>
Lookup a host, returning a Future of a list of InternetAddresss. If type is InternetAddressType.ANY, it will lookup both IP version 4 (IPv4) and IP version 6 (IPv6) addresses. If type is either InternetAddressType.IPv4 or InternetAddressType.IPv6 it will only lookup addresses of the specified type. The order of the list can, and most likely will, change over time.

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dartlang.org/stable/2.0.0/dart-io/InternetAddress-class.html