Specifications

Getting Started 33
The program then resolves the address to be pinged into a numeric value. using the library
function resolve(). If the defined address is numeric, it converts the define string into
truly numeric form. If the address is a domain name, the function queries the indicated
DNS server to obtain the numeric address. (If the function is unable to resolve the
addressif, for example, the numeric address is incomplete or badly formed, or the DNS
server is unable to identify the domain namethe program will print a message to the
screen and terminate.)
The program then begins an endless loop using for(;;). Within this loop, the program
executes the following steps:
1. Calls tcp_tick( ) to perform the basic housekeeping functions for the socket;
2. As a costatement, waits for the duration of PING_DELAY (defined by default as 500 ms
or one-half second), issues a ping to the resolved address using the
_ping() function,
and flashes LED DS2;
3. As a second costatement, checks for a ping return using the _chk_ping() function. If
the ping is successful, the costatement flashes LED DS3.
If you uncomment the #VERBOSE define near the beginning of the program, the ping
return costatement will also print a message to the screen indicating each successful ping.
More Information
Refer to the Dynamic C TCP/IP Users Manual for complete details on the Dynamic C
implementation of TCP/IP protocols.