The InetAddress Class

Figure 6-2. The InetAddress Class

address method

>>--address()--------------------------------------------------><

This method returns the ip address of the original hostname.

address= method

>>--address(ipaddress)-----------------------------------------><

family method)

>>--family()---------------------------------------------------><

This method returns the ip address family of the original hostname.

family= method

>>--family(newfamily)------------------------------------------><

This method sets the ip address family of the original hostname.

init method

>>--init(hostname, port +------------+--)----------------------><
                        +--, family--+

This method creates a new instance of the InetAddress class.

hostname

The ip address or host name of the host machine.

port

The port number of the connection.

family

The address family. The only valid value is AF_INET.

makeStem method

>>--makeStem()-------------------------------------------------><

This method returns a stem variable set to the current values of the instance. This method has limited usefulness to the programmer.

port method

>>--port()-----------------------------------------------------><

This method returns port number of the original hostname.

port= method

>>--port(newport)----------------------------------------------><

This method sets the port number of the original hostname.

The HostInfo Class

Figure 6-3. The HostInfo Class

addr method

>>--addr()-----------------------------------------------------><

This method returns an array of ip addresses of the host.

address method

>>--address()--------------------------------------------------><

This method returns the main ip address of the host.

alias method

>>--alias()----------------------------------------------------><

This method returns an array of alias host name of the host.

name method

>>--alias()----------------------------------------------------><

This method returns the main host name of the host.

init method

>>--init(hostname)---------------------------------------------><

This method create an instance of the HostInfo class and sets all the attribute methods of the instance. The hostname can be either a valid DNS host name or an ip address.

makeStem method

>>--makeStem()-------------------------------------------------><

This method returns a stem variable set to the current values of the instance. This method has limited usefulness to the programmer.