string->hostaddr

Name

string->hostaddr -- Resolve a host name or dotted IP address.

Type: function

Synopsis

string->hostaddr( spec, host);

Arguments

spec

An instance of <string>

Return Values

host

An instance of <inet-addr>

Description

This procedure converts a string into a <inet-addr>. If the first character of the string is a digit, then the string is interpreted as a dotted IP address (e.g., 204.71.200.72). Otherwise, it is interpreted as a host name and resolved using gethostbyname.

If the host name cannot be found, or it has no address, or if the resolver library encounters some other error, a <resolver-error> condition is signalled.