//====================================================== file = udpPing.c ===== //= A UDP ping client that sends a "PING" and listens for a "PONG" = //============================================================================= //= Notes: = //= 1) This program conditionally compiles for Winsock and BSD sockets. = //= Set the initial #define to WIN or BSD as appropriate. = //= 2) This program needs udpPong to be running on the other host = //= Program udpPong must be started first. = //= 3) This program takes command line input for udpPong host IP address = //= and number of PING to send = //= 4) If a PONG response is not received, this program hangs = //=---------------------------------------------------------------------------= //= Example execution: (udpPong and udpPing running on host 127.0.0.1) = //= udpPing 127.0.0.1 5 = //= PONG received from IP = 127.0.0.1 -- RTT = 110 ms = //= PONG received from IP = 127.0.0.1 -- RTT = 110 ms = //= PONG received from IP = 127.0.0.1 -- RTT = 110 ms = //= PONG received from IP = 127.0.0.1 -- RTT = 110 ms = //= PONG received from IP = 127.0.0.1 -- RTT = 110 ms = //=---------------------------------------------------------------------------= //= Build: = //= Windows (WIN): Borland: bcc32 udpPing.c = //= MinGW: gcc udpPing.c -lws2_32 -o updPing = //= Visual C: cl ucpPing.c wsock32.lib = //= Unix/Mac (BSD): gcc ucpPing.c -lnsl -o ucpPing = //=---------------------------------------------------------------------------= //= Execute: udpPing ip_addr num_ping = //=---------------------------------------------------------------------------= //= Author: << YOUR NAME >> = //= University of South Florida = //= Email: << YOUR EMAIL ADDRESS >> = //=---------------------------------------------------------------------------= //= History: << YOUR INITIALS >> (09/__/18) - Genesis (from udpClient.c) = //=============================================================================