TCP/IP Sockets in C

1st Edition

Practical Guide for Programmers

Authors: Michael Donahoo Kenneth Calvert
Paperback ISBN: 9781558608269
eBook ISBN: 9780080518473
Imprint: Morgan Kaufmann
Published Date: 14th November 2001
Page Count: 130
Tax/VAT will be calculated at check-out
Compatible Not compatible
VitalSource PC, Mac, iPhone & iPad Amazon Kindle eReader
ePub & PDF Apple & PC desktop. Mobile devices (Apple & Android) Amazon Kindle eReader
Mobi Amazon Kindle eReader Anything else

Institutional Access

Table of Contents

I Tutorial

1 Introduction

1.1 Networks, Packets and Protocols

1.2 About Addresses

1.3 Clients and Servers

1.4 What is a Socket?

2 Basic Sockets

2.1 Creating and Destroying

2.2 Specifying Addresses

2.3 TCP Client

2.4 TCP Server

3 Constructing Messages

3.1 Encoding Data

3.2 Byte Ordering

3.3 Alignment and Padding

3.4 Framing and Parsing

4 Using UDP Sockets

4.1 UDP Client

4.2 UDP Server

4.3 Sending and Receiving with UDP Sockets

5 Socket Programming

5.1 Socket Options

5.2 Signals

5.3 Nonblocking I/O

5.3.1 Nonblocking Sockets

5.3.2 Asynchronous I/O

5.3.3 Timeouts

5.4 Multitasking

5.4.1 Per-client Processes

5.4.2 Per-client Thread

5.4.3 Constrained-Multitasking

5.5 Multiplexing

<BR id


For example code from the text, Winsock adaptations of text code, sample programming exercises and more, click on the grey "COMPANION SITE" button to the right.

Note: This title was formerly known as Pocket Guide to TCP/IP Socket Programming in C, ISBN 1-55860-686-6.

TCP/IP Sockets in C: Practical Guide for Programmers is a quick and affordable way to gain the knowledge and skills you need to develop sophisticated and powerful networked-based programs using sockets. Written by two experienced networking instructors, this book provides a series of examples that demonstrate basic sockets techniques for clients and servers.

Using plenty of real-world examples, this book is a complete beginner's guide to socket programming and a springboard to more advanced networking topics, including multimedia protocols.

Key Features

Concise, no-nonsense explanations of issues often troublesome for beginners, including message construction and parsing. Comprehensive example-based coverage of the most important TCP/IP techniques-including iterative and concurrent servers, timeouts, and asynchronous message processing. Includes a detailed, easy-to-use reference to the system calls and auxiliary routines that comprise the sockets interface. A companion Web site provides source code for all example programs in both C and WinSock versions, as well as guidance on running the code on various platforms.


network programers, application developers, software engineers and computer science students studying networking


No. of pages:
© Morgan Kaufmann 2001
Morgan Kaufmann
eBook ISBN:
Paperback ISBN:


@qu:"This book fills a void in the area of networking education. The presentation is easily accessible to students, with lots of code examples. It will be an excellent companion to traditional networking textbooks for use in undergraduate and introductory graduate courses." @source:—Ellen W. Zegura, Georgia Institute of Technology @qu:"This is the best, all-in-one socket book I have read and yet it doesn't come with the unnecessary overhead of many other books. It is loaded with very useful examples and it can be used as a socket API reference as well. In a word, it is a very well written book that has everything practitioners need." @source:—Steve Bernier, Communications Research Center

About the Authors

Michael Donahoo Author

Michael J. Donahoo teaches networking to undergraduate and graduate students at Baylor University, where he is an assistant professor. He received his Ph.D. in computer science from the Georgia Institute of Technology. His research interests are in large-scale information dissemination and management.

Affiliations and Expertise

Baylor University, Waco, TX, USA

Kenneth Calvert Author

Kenneth L. Calvert is an associate professor at University of Kentucky, where he teaches and does research on the design and implementation of computer network protocols. He has been doing networking research since 1987, and teaching since 1991. He holds degrees from MIT, Stanford, and the University of Texas at Austin.

Affiliations and Expertise

University of Kentucky, Lexington, KY, USA