Skip to main content

TCP/IP Sockets in C

Practical Guide for Programmers

  • 1st Edition - November 14, 2001
  • Latest edition
  • Authors: Michael J. Donahoo, Kenneth L. Calvert
  • Language: English

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: Thi… Read more

World Book Day celebration

Where learning shapes lives

Up to 25% off trusted resources that support research, study, and discovery.

Description

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.

Readership

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

Table of contents

I Tutorial1 Introduction1.1 Networks, Packets and Protocols1.2 About Addresses1.3 Clients and Servers1.4 What is a Socket?2 Basic Sockets2.1 Creating and Destroying2.2 Specifying Addresses2.3 TCP Client2.4 TCP Server3 Constructing Messages3.1 Encoding Data3.2 Byte Ordering3.3 Alignment and Padding3.4 Framing and Parsing4 Using UDP Sockets4.1 UDP Client4.2 UDP Server4.3 Sending and Receiving with UDP Sockets5 Socket Programming5.1 Socket Options5.2 Signals5.3 Nonblocking I/O5.3.1 Nonblocking Sockets5.3.2 Asynchronous I/O5.3.3 Timeouts5.4 Multitasking5.4.1 Per-client Processes5.4.2 Per-client Thread5.4.3 Constrained-Multitasking5.5 Multiplexing5.6 Multiple Recipients5.6.1 Broadcast5.6.2 Multicast5.6.3 Broadcast vs. Multicast6 Under The Hood6.1 Buffering and TCP6.2 Deadlock6.3 Performance Implications6.4 TCP Socket Life Cycle6.4.1 Connecting6.4.2 Closing A TCP Connection6.5 Demultiplexing Demystified7 Domain Name Service7.1 Mapping Between Names and Internet addresses7.2 Finding Service Information by NameII API ReferenceData Structuressockaddrsockaddr_inSocket Setupsocket()bind()getsockname()Socket Connectionconnect() listen()accept()getpeername()Socket Communicationsend() sendto()recv()recvfrom()close()shutdown()Socket Controlgetsockopt()setsockopt()Binary/String Conversioninet_ntoa()inet_addr()htons(), htonl(), ntohs(), ntohl()Host and Service Informationgethostname()gethostbyname()gethostbyaddr()getservbyname()getservbyport()

Review quotes

"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."—Ellen W. Zegura, Georgia Institute of Technology

"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."—Steve Bernier, Communications Research Center

Product details

  • Edition: 1
  • Latest edition
  • Published: February 13, 2002
  • Language: English

About the authors

MD

Michael J. Donahoo

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

KC

Kenneth L. Calvert

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

View book on ScienceDirect

Read TCP/IP Sockets in C on ScienceDirect