dart:io
InternetAddress class
An internet address or a Unix domain 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, {@Since("2.8") InternetAddressType? type})
factory
- Creates a new InternetAddress from a numeric address or a file path.
- InternetAddress.fromRawAddress(Uint8List rawAddress, {@Since("2.8") InternetAddressType? type})
factory
- Creates a new InternetAddress from the provided raw address bytes.
Properties
- address → String
read-only
- The numeric address of the host.
- hashCode → int
read-only, inherited
- The hash code for this object.
- host → String
read-only
- The host used to lookup the address.
- isLinkLocal → bool
read-only
- Whether the scope of the InternetAddress is a link-local.
- isLoopback → bool
read-only
- Whether the InternetAddress is a loopback address.
- isMulticast → bool
read-only
- Whether the scope of the InternetAddress is multicast.
- rawAddress → Uint8List
read-only
- The raw address of this InternetAddress.
- runtimeType → Type
read-only, inherited
- A representation of the runtime type of the object.
- type → InternetAddressType
read-only
- The address family of the InternetAddress.
Methods
- noSuchMethod(Invocation invocation) → dynamic
inherited
- Invoked when a non-existent method or property is accessed.
- reverse() → Future<InternetAddress>
- Performs a reverse DNS lookup on this address
- toString() → String
inherited
- A string representation of this object.
Operators
- operator ==(Object other) → bool
inherited
- The equality operator.
Static Properties
- anyIPv4 → InternetAddress
read-only
- IP version 4 any address.
- anyIPv6 → InternetAddress
read-only
- IP version 6 any address.
- loopbackIPv4 → InternetAddress
read-only
- IP version 4 loopback address.
- loopbackIPv6 → InternetAddress
read-only
- IP version 6 loopback address.
Static Methods
- lookup(String host, {InternetAddressType type = InternetAddressType.any}) → Future<List<InternetAddress>>
- Looks up the addresses of a host.
- tryParse(String address) → InternetAddress?
- Attempts to parse
address as a numeric address.