Book description
This book teaches readers how to program Linux sockets, and gives them everything they need to know to make programs communicate effetively over networks.
It presents a comprehensive discussion of all relevant topics including: writing programs compatible with both Internet Protocol version 4 (IPv4) and IPv6, raw sockets, User Datagram Protocol (UDP), broadcasting /multicasting, server internals, and more, plus a section covering Posix threads.
It provides thorough coverage of programming with the TCP, UDP, and IP protocols, as well as lower-level raw sockets. The myriad of function calls, data structures, and options associated with the APIs are explained with well-chosen diagrams and tables.
After reading this book, the reader will be able to:
Differentiate basic datagrams vs. streaming sockets.
Differentiate unicast, broadcast, and multicast sockets.
Write socket-based network programs.
Write portable code for various OS'.
Implement client-server and peer communications
Increase network throughput using "connectionless" communications
Manage asynchronous I/O, I/O and multiple sockets.
Use signals, threading and processes to manage socket connections.
Understand new socket technologies like Mbone and 6bone.
Understand Remote Procedure Calls and how to implement them.
Understand the different socket addressing types.
Table of contents
- Copyright
- About the Author
- Acknowledgments
- Tell Us What You Think!
- Introduction
-
I. Network Programming from the Client Perspective
- 1. Introducing the Cookbook Network Client
- 2. TCP/IP Network Language Fluency
- 3. Different Types of Internet Packets
- 4. Sending Messages Between Peers
- 5. Understanding the Network Layering Model
-
II. The Server Perspective and Load Control
-
6. A Server Primer
- Mapping the Socket: The Server's General Program Flow
- A Simple Echo Server
-
General Rules About Defining Protocols
- Which Program Talks First?
- Which Program Drives the Conversation?
- What Level of Certification Do You Need?
- What Type of Data Do You Use?
- How Do You Handle Binary Data?
- How Do You Know when There Is a Deadlock?
- Do You Need Clock Synchronization?
- How and When Do You Restart the Connection?
- When Are You Finished?
- An Extended Example: An HTTP Directory Server
- Summary: The Server's Basic Elements
-
7. Dividing the Load: Multitasking
- Defining Multitasking: Processes Versus Threads
- Beating the Clock: Race Conditions and Mutexs
- Controlling Children and Killing Zombies
- Extending Current Clients and Servers
- Calling External Programs with the exec Server
- Summary: Distributing the Process Load
- 8. Choosing when to Wait for I/O
-
9. Breaking Performance Barriers
- Creating the Servlets Before the Client Arrives
- Extending Control with a Smart Select
- Delving Deeper into Socket Control
- Recovering the Socket Descriptor
- Sending Before Received: Message Interleave
- Noting File I/O Problems
- Using Demand-Based I/O to Recover CPU Time
- Sending High-Priority Messages
- Summary: Pulling Together Performance Features
- 10. Designing Robust Linux Sockets
-
6. A Server Primer
-
III. Looking at Sockets Objectively
- 11. Saving Time with Objects
- 12. Using Java's Networking API
-
13. Designing and Using a C++ Socket Framework
- Why Use C++ for Sockets Programming?
- Laying Out the Framework
- Testing the Socket Framework
- Implementation Limitations
- Summary: A C++ Socket Framework Simplifies Programming
- 14. Limits to Objects
-
IV. Advanced Sockets—Adding Value
- 15. Network Encapsulation with Remote Procedure Calls (RPCs)
- 16. Adding Security to Network Programs and SSL
- 17. Sharing Messages with Multicast, Broadcast, and Mbone
- 18. The Power of Raw Sockets
- 19. IPv6: The Next Generation to IP
-
V. Appendixes
-
A. Data Tables
- Domains: First Parameter to socket()
- Types: Second Parameter to socket()
- Protocol Definitions
- Standard Internet Port Assignments (First 100 Ports)
- HTTP 1.1 Status Codes
- Socket Options (get/setsockopt())
- Signal Definitions
- ICMP Codes
- IPv4 Multicast Allocation
- Proposed IPv6 Address Allocation
- ICMPv6 Codes
- IPv6 Multicast Scope Field
- IPv6 Multicast Flags Field
-
B. Networking API
- Connecting to the Network
- Terminating Connections
- Network Data Conversions
- Network Addressing Tools
- Socket Controls
- C. Kernel API Subset
- D. Object Classes
-
A. Data Tables
Product information
- Title: Linux® Socket Programming
- Author(s):
- Release date: January 2001
- Publisher(s): Sams
- ISBN: 9780672319358
You might also like
book
Network Programming with Go
Go combines the best parts of many other programming languages. It’s fast, scalable, and designed for …
book
The Sockets Networking API: UNIX® Network Programming Volume 1, Third Edition
UNIX Network Programming, Volume 1: The Sockets Networking API, Third Edition "Everyone will want this book …
book
Linux Kernel Programming
Learn how to write high-quality kernel module code, solve common Linux kernel programming issues, and understand …
book
Linux System Programming, 2nd Edition
Write software that draws directly on services offered by the Linux kernel and core system libraries. …