Ping: Returns Packet

Click to open or copy the files for the Ping sample.

Click to open or copy the Testlib directory (required).

This sample opens a socket, binds to the socket, receives a packet, and sends that packet back to the original sender.

The DOS subdirectory contains DosPing.c.

Building SDK Samples

This sample uses the following keywords:

bind; closesocket; do_ping; dos_net_perror; exit; free; getsockname; makeword; malloc; memcpy; net_init; parse_cmd_line; print_netaddr; print_saddr; print_wsa; printf; recvfrom; sendto; setsockopt; socket; wsastartup