Sockets
Address
perform hostname to IP address mappings
Calling Sequence
Parameters
Description
Examples
References
Address(who)
who
-
Maple string; contains a symbolic hostname or an IP address in base 256 notation
The procedure Address can be used to map symbolic, human-readable hostnames to numeric IP addresses written in "dotted quad" or "base 256" notation. In all cases, the argument who must be of type string.
Given a symbolic hostname, such as www.maplesoft.com, Address returns its numeric IP address in base 256 notation in the form of a string. This is a sequence of four numbers, each between 0 and 255, and separated by dots that represents the internet address of the named host. The details of IP number structure and special case assignments are specified in RFC 1700 Assigned Numbers.
Conversely, given a numeric IP address in base 256 notation, such as 192.139·233.26, Address returns a symbolic, human-readable hostname in the form of a string. Since a given node on a network may have multiple hostnames, it is the "canonical" hostname that is returned. (Thus, Address is not quite an involution.)
with⁡Sockets:
Address⁡www.maplesoft.com
10.102.2.2
Address⁡127.0.0.1
localhost
Address⁡10.10.10.169
rdsomantis.maplesoft.com
Address⁡localhost
127.0.0.1
Address⁡world.std.com
192.74.137.5
Get the canonical hostname from any given hostname by applying Address to its own output.
Address⁡Address⁡www.w3c.org
webredir.vip.gandi.net
Information Sciences Institute, "RFC 1700 Assigned Numbers," ISI Home Page, http://www.isi.edu/in-notes/rfc1700.txt; accessed 17 November 2005.
See Also
type/string
Download Help Document