InternetAddress class - dart:io library (original) (raw)

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})

Creates a new InternetAddress from a numeric address or a file path.

factory

InternetAddress.fromRawAddress(Uint8List rawAddress, {@Since("2.8") InternetAddressType? type})

Creates a new InternetAddress from the provided raw address bytes.

factory

Properties

addressString

The numeric address of the host.

no setter

hashCodeint

The hash code for this object.

no setterinherited

hostString

The host used to lookup the address.

no setter

isLinkLocalbool

Whether the scope of the InternetAddress is a link-local.

no setter

isLoopbackbool

Whether the InternetAddress is a loopback address.

no setter

isMulticastbool

Whether the scope of the InternetAddress is multicast.

no setter

rawAddressUint8List

The raw address of this InternetAddress.

no setter

runtimeTypeType

A representation of the runtime type of the object.

no setterinherited

typeInternetAddressType

The address family of the InternetAddress.

no setter

Methods

noSuchMethod(Invocation invocation)→ dynamic

Invoked when a nonexistent method or property is accessed.

inherited

reverse()→ Future<InternetAddress>

Performs a reverse DNS lookup on this address

toString()→ String

A string representation of this object.

inherited

Operators

operator ==(Object other)→ bool

The equality operator.

inherited

Static Properties

anyIPv4InternetAddress

IP version 4 any address.

no setter

anyIPv6InternetAddress

IP version 6 any address.

no setter

loopbackIPv4InternetAddress

IP version 4 loopback address.

no setter

loopbackIPv6InternetAddress

IP version 6 loopback address.

no setter

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.