Below is the example source code from "TCP/IP Sockets in C: Practical Guide for Programmers" by Michael J. Donahoo and Kenneth L. Calvert. This book can be ordered at your favorite local bookstore or online. Official Book Website Disclaimer: The purpose of this book is to provide general information about network programming as of the book's publication date. The authors have included sample code