EmbeddedRelated.com
Books
Jacob Beningo
Live online course · Jacob Beningo
AI for Embedded Developers
$100 off for EmbeddedRelated readers until Dec 6 · 5 live sessions, Dec 7-11
Discount ends in
28days 02hrs 04min 21sec
Learn More →

TCP/IP Sockets in C: Practical Guide for Programmers (Morgan Kaufmann Practical Guides)

Donahoo, Michael J., Calvert, Kenneth L. ● 2009

TCP/IP Sockets in C: Practical Guide for Programmers, Second Edition is a quick and affordable way to gain the knowledge and skills needed to develop sophisticated and powerful web-based applications. The book'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. This edition has been expanded to include new advancements such as support for IPv6 as well as detailed defensive programming strategies.

If you program using Java, be sure to check out this book’s companion, TCP/IP Sockets in Java: Practical Guide for Programmers, 2nd Edition.

  • Includes completely new and expanded sections that address the IPv6 network environment, defensive programming, and the select() system call, thereby allowing the reader to program in accordance with the most current standards for internetworking.
  • Streamlined and concise tutelage in conjunction with line-by-line code commentary allows readers to quickly program web-based applications without having to wade through unrelated and discursive networking tenets.


Why Read This Book

You will learn pragmatic, ready-to-run techniques for building reliable client/server software in C using the Berkeley sockets API — including modern features like IPv6 and defensive programming practices. The book is concise and example-driven, so you can quickly apply patterns to embedded Linux, IoT devices, or firmware that needs robust network I/O.

Who Will Benefit

Embedded and firmware engineers, IoT developers, or systems programmers with some C and networking background who need to implement or debug TCP/UDP network services on Linux/RTOS platforms.

Level: Intermediate — Prerequisites: Working knowledge of C programming, basic TCP/IP concepts (IP, TCP, UDP), and familiarity with Unix-like development environments (shell, compiling with gcc).

Get This Book

Key Takeaways

  • Implement TCP client and server programs using stream sockets in C
  • Build UDP-based applications and handle datagram semantics correctly
  • Use nonblocking I/O, select()/poll(), and timeouts to write responsive, concurrent servers
  • Support IPv6 and write code that handles both IPv4 and IPv6 address families
  • Practice defensive programming and robust error-handling to harden networked embedded code

Topics Covered

  1. Introduction to Sockets and Network Programming
  2. Basic TCP Sockets: Stream Client and Server
  3. Basic UDP Sockets: Datagram Programming
  4. Address Manipulation and Name Resolution (IPv4/IPv6)
  5. Concurrent Servers: fork(), threads, and select()/poll()
  6. Nonblocking I/O, Timeouts, and Multiplexing
  7. IPv6: Concepts and Practical Coding Patterns
  8. Defensive Programming and Robust Error Handling
  9. Common Protocol Patterns and Example Applications
  10. Debugging and Testing Network Programs (tools and strategies)
  11. Appendices: Socket Options, Constants, and Helpful Utilities

Languages, Platforms & Tools

CPOSIX / LinuxBSDEmbedded Linux / IoT devices (practical examples translate to RTOS sockets)gcc / makegdbWireshark / tcpdumpnetcat / telnet

How It Compares

More concise and example-focused than Stevens' "Unix Network Programming"—a quicker, hands-on route to socket coding; similar in tutorial style to Beej's Guide but with a polished, published treatment and IPv6 emphasis.

Related Books

Bryant, Randal, O'Hallaron,...