TCP/IP Sockets in C

by ;
  • ISBN13:


  • ISBN10:


  • Edition: 2nd
  • Format: Paperback
  • Copyright: 2009-03-17
  • Publisher: Morgan Kaufmann Pub

Note: Supplemental materials are not guaranteed with Rental or Used book purchases.

Purchase Benefits

  • Free Shipping On Orders Over $35!
    Your order must be $35 or more to qualify for free economy shipping. Bulk sales, PO's, Marketplace items, eBooks and apparel do not qualify for this offer.
  • Get Rewarded for Ordering Your Textbooks! Enroll Now
  • We Buy This Book Back!
    In-Store Credit: $2.10
    Check/Direct Deposit: $2.00
List Price: $36.21 Save up to $23.47
  • Rent Book $12.74
    Add to Cart Free Shipping


Supplemental Materials

What is included with this book?

  • The New copy of this book will include any supplemental materials advertised. Please check the title of the book to determine if it should include any access cards, study guides, lab manuals, CDs, etc.
  • The Used, Rental and eBook copies of this book are not guaranteed to include any supplemental materials. Typically, only the book itself is included. This is true even if the title states it includes any access cards, study guides, lab manuals, CDs, etc.


Written by two experienced networking instructors, this text's focused, tutorial-based approach enables the reader to master the tasks and techniques essential to virtually all client-server projects using sockets in C.

Author Biography

Michael J. Donahoo teaches networking on the undergraduate and graduate level at Baylor University, Where he is an associate professor. He has authored Socket programming books for a variety of languages and an SQL book. Kenneth L. Calvert is a professor at the University of Kentucky, where he teaches and researches computer network systems. He has been writing socket programs with TCP/IP for almost twenty years.

Table of Contents

Preface to the Second Editionp. ix
Introductionp. 1
Networks, Packets, and Protocolsp. 1
About Addressesp. 4
Writing Down IP Addressesp. 4
Dealing with Two Versionsp. 5
Port Numbersp. 5
Special Addressesp. 6
About Namesp. 7
Clients and Serversp. 7
What Is a Socket?p. 8
Basic TCP Socketsp. 11
IPv4 TCP Clientp. 11
IPv4 TCP Serverp. 17
Creating and Destroying Socketsp. 22
Specifying Addressesp. 23
Generic Addressesp. 23
IPv4 Addressesp. 24
IPv4 Addressesp. 24
Generic Address Storagep. 25
Binary/String Address Conversionp. 26
Getting a Socket's Associated Addressesp. 26
Connecting a Socketp. 27
Binding to an Addressp. 27
Handling Incoming Connectionsp. 28
Communicationp. 30
Using IPv6p. 30
Of Names and Address Familiesp. 35
Mapping Names to Numbersp. 35
Accessing the Name Servicep. 36
Details, Detailsp. 40
Writing Address-Generic Codep. 41
Generic TCP Clientp. 43
Generic TCP Serverp. 46
IPv4-IPv6 Interoperationp. 49
Getting Names from Numbersp. 50
Using UDP Socketsp. 53
UDP Clientp. 54
UDP Serverp. 57
Sending and Receiving with UDP Socketsp. 60
Connecting a UDP Socketp. 61
Sending and Receiving Datap. 63
Encoding Integersp. 64
Sizes of Integersp. 64
Byte Orderingp. 66
Signedness and Sign Extensionp. 67
Encoding Integers by Handp. 68
Wrapping TCP Sockets in Streamsp. 71
Structure Overlays: Alignment and Paddingp. 73
Strings and Textp. 76
Bit-Diddling: Encoding Booleansp. 78
Constructing, Framing, and Parsing Messagesp. 79
Framingp. 86
Text-Based Message Encodingp. 91
Binary Message Encodingp. 94
Putting It All Togetherp. 96
Wrapping Upp. 97
Beyond Basic Socket Programmingp. 99
Socket Optionsp. 99
Signalsp. 100
Nonblocking I/Op. 106
Nonblocking Socketsp. 107
Asynchronous I/Op. 108
Timeoutsp. 112
Multitaskingp. 116
Per-Client Processesp. 117
Per-Client Threadp. 123
Constrained Multitaskingp. 126
Multiplexingp. 128
Multiple Recipientsp. 133
Broadcastp. 134
Multicastp. 137
Broadcast vs. Multicastp. 142
Under the Hoodp. 143
Buffering and TCPp. 145
Deadlock Dangerp. 148
Performance Implicationsp. 149
TCP Socket Life Cyclep. 150
Connectingp. 150
Closing a TCP Connectionp. 154
Demultiplexing Demystifiedp. 158
Socket Programming in C++p. 161
PracticalSocket Library Overviewp. 162
Plus One Servicep. 164
Plus One Serverp. 164
Plus One Clientp. 166
Running Server and Clientp. 168
Survey Servicep. 168
Survey Support Functionsp. 169
Survey Serverp. 172
Survey Clientp. 176
Running Server and Clientp. 178
Survey Service, Mark 2p. 178
Socket Address Supportp. 179
Socket Iostream Interfacep. 180
Enhanced Survey Serverp. 181
Enhanced Survey Clientp. 186
Administrative Clientp. 187
Running Server and Clientsp. 188
Referencesp. 191
Indexp. 193
Table of Contents provided by Ingram. All Rights Reserved.

Rewards Program

Write a Review