Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.
Page 1 of 2
[ Team LiB ]
Table of Contents
•
UNIX® Network Programming Volume 1, Third Edition: The Sockets Networking
API
By W. Richard Stevens, Bill Fenner, Andrew M. Rudoff
Publisher
Pub Date
ISBN
Pages
: Addison Wesley
: November 21, 2003
: 0-13-141155-1
: 1024
"Everyone will want this book because it provides a great mix of practical experience, historical
perspective, and a depth of understanding that only comes from being intimately involved in
the field. I've already enjoyed and learned from reading this book, and surely you will too."
-Sam Leffler
The classic guide to UNIX networking APIs... now completely updated!
To build today's highly distributed, networked applications and services, you need deep mastery
of sockets and other key networking APIs. One book delivers comprehensive, start-to-finish
guidance for building robust, high-performance networked systems in any environment: UNIX
Network Programming, Volume 1, Third Edition.
Building on the legendary work of W. Richard Stevens, this edition has been fully updated by
two leading network programming experts to address today's most crucial standards,
implementations, and techniques. New topics include:
POSIX Single UNIX Specification Version 3
IPv6 APIs (including updated guidance on IPv6/IPv4 interoperability)
The new SCTP transport protocol
IPsec-based Key Management Sockets
FreeBSD 4.8/5.1, Red Hat Linux 9.x, Solaris 9, AIX 5.x, HP-UX, and Mac OS X
implementations
New network program debugging techniques
mk:@MSITStore:E:\9编程宝典\0Programming\Network\Unix+Network+Programmin...
2012-1-11
Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.
Page 2 of 2
Source Specific Multicast API, the key enabler for widespread IP multicast deployment
The authors also update and extend Stevens' definitive coverage of these crucial UNIX
networking standards and techniques:
TCP and UDP transport
Sockets: elementary, advanced, routed, and raw
I/O: multiplexing, advanced functions, nonblocking, and signal-driven
Daemons and inetd
UNIX domain protocols
ioctl operations
Broadcasting and multicasting
Threads
Streams
Design: TCP iterative, concurrent, preforked, and prethreaded servers
Since 1990, network programmers have turned to one source for the insights and techniques
they need: W. Richard Stevens' UNIX Network Programming. Now, there's an edition specifically
designed for today's challenges-and tomorrow's.
[ Team LiB ]
mk:@MSITStore:E:\9编程宝典\0Programming\Network\Unix+Network+Programmin...
2012-1-11
[ Team LiB ]
Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.
Page 1 of 9
Table of Contents
•
UNIX® Network Programming Volume 1, Third Edition: The Sockets Networking
API
By W. Richard Stevens, Bill Fenner, Andrew M. Rudoff
Publisher
Pub Date
ISBN
Pages
: Addison Wesley
: November 21, 2003
: 0-13-141155-1
: 1024
Copyright
Addison-Wesley Professional Computing Series
Foreword
Preface
Introduction
Changes from the Second Edition
Using This Book
Source Code and Errata Availability
Acknowledgments
Part 1: Introduction and TCP/IP
Chapter 1. Introduction
Section 1.1. Introduction
Section 1.2. A Simple Daytime Client
Section 1.3. Protocol Independence
Section 1.4. Error Handling: Wrapper Functions
Section 1.5. A Simple Daytime Server
Section 1.6. Roadmap to Client/Server Examples in the Text
Section 1.7. OSI Model
Section 1.8. BSD Networking History
Section 1.9. Test Networks and Hosts
Section 1.10. Unix Standards
Section 1.11. 64-Bit Architectures
Section 1.12. Summary
Exercises
Chapter 2. The Transport Layer: TCP, UDP, and SCTP
Section 2.1. Introduction
Section 2.2. The Big Picture
Section 2.3. User Datagram Protocol (UDP)
Section 2.4. Transmission Control Protocol (TCP)
mk:@MSITStore:E:\9编程宝典\0Programming\Network\Unix+Network+Programmin...
2012-1-11
Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.
Page 2 of 9
Section 2.5. Stream Control Transmission Protocol (SCTP)
Section 2.6. TCP Connection Establishment and Termination
Section 2.7. TIME_WAIT State
Section 2.8. SCTP Association Establishment and Termination
Section 2.9. Port Numbers
Section 2.10. TCP Port Numbers and Concurrent Servers
Section 2.11. Buffer Sizes and Limitations
Section 2.12. Standard Internet Services
Section 2.13. Protocol Usage by Common Internet Applications
Section 2.14. Summary
Exercises
Part 2: Elementary Sockets
Chapter 3. Sockets Introduction
Section 3.1. Introduction
Section 3.2. Socket Address Structures
Section 3.3. Value-Result Arguments
Section 3.4. Byte Ordering Functions
Section 3.5. Byte Manipulation Functions
Section 3.6. inet_aton, inet_addr, and inet_ntoa Functions
Section 3.7. inet_pton and inet_ntop Functions
Section 3.8. sock_ntop and Related Functions
Section 3.9. readn, writen, and readline Functions
Section 3.10. Summary
Exercises
Chapter 4. Elementary TCP Sockets
Section 4.1. Introduction
Section 4.2. socket Function
Section 4.3. connect Function
Section 4.4. bind Function
Section 4.5. listen Function
Section 4.6. accept Function
Section 4.7. fork and exec Functions
Section 4.8. Concurrent Servers
Section 4.9. close Function
Section 4.10. getsockname and getpeername Functions
Section 4.11. Summary
Exercises
Chapter 5. TCP Client/Server Example
Section 5.1. Introduction
Section 5.2. TCP Echo Server: main Function
Section 5.3. TCP Echo Server: str_echo Function
Section 5.4. TCP Echo Client: main Function
Section 5.5. TCP Echo Client: str_cli Function
Section 5.6. Normal Startup
Section 5.7. Normal Termination
Section 5.8. POSIX Signal Handling
Section 5.9. Handling SIGCHLD Signals
Section 5.10. wait and waitpid Functions
Section 5.11. Connection Abort before accept Returns
Section 5.12. Termination of Server Process
Section 5.13. SIGPIPE Signal
Section 5.14. Crashing of Server Host
Section 5.15. Crashing and Rebooting of Server Host
Section 5.16. Shutdown of Server Host
mk:@MSITStore:E:\9编程宝典\0Programming\Network\Unix+Network+Programmin...
2012-1-11
Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.
Page 3 of 9
Section 5.17. Summary of TCP Example
Section 5.18. Data Format
Section 5.19. Summary
Exercises
Chapter 6. I/O Multiplexing: The select and poll Functions
Section 6.1. Introduction
Section 6.2. I/O Models
Section 6.3. select Function
Section 6.4. str_cli Function (Revisited)
Section 6.5. Batch Input and Buffering
Section 6.6. shutdown Function
Section 6.7. str_cli Function (Revisited Again)
Section 6.8. TCP Echo Server (Revisited)
Section 6.9. pselect Function
Section 6.10. poll Function
Section 6.11. TCP Echo Server (Revisited Again)
Section 6.12. Summary
Exercises
Chapter 7. Socket Options
Section 7.1. Introduction
Section 7.2. getsockopt and setsockopt Functions
Section 7.3. Checking if an Option Is Supported and Obtaining the Default
Section 7.4. Socket States
Section 7.5. Generic Socket Options
Section 7.6. IPv4 Socket Options
Section 7.7. ICMPv6 Socket Option
Section 7.8. IPv6 Socket Options
Section 7.9. TCP Socket Options
Section 7.10. SCTP Socket Options
Section 7.11. fcntl Function
Section 7.12. Summary
Exercises
Chapter 8. Elementary UDP Sockets
Section 8.1. Introduction
Section 8.2. recvfrom and sendto Functions
Section 8.3. UDP Echo Server: main Function
Section 8.4. UDP Echo Server: dg_echo Function
Section 8.5. UDP Echo Client: main Function
Section 8.6. UDP Echo Client: dg_cli Function
Section 8.7. Lost Datagrams
Section 8.8. Verifying Received Response
Section 8.9. Server Not Running
Section 8.10. Summary of UDP Example
Section 8.11. connect Function with UDP
Section 8.12. dg_cli Function (Revisited)
Section 8.13. Lack of Flow Control with UDP
Section 8.14. Determining Outgoing Interface with UDP
Section 8.15. TCP and UDP Echo Server Using select
Section 8.16. Summary
Exercises
Chapter 9. Elementary SCTP Sockets
Section 9.1. Introduction
Section 9.2. Interface Models
Section 9.3. sctp_bindx Function
mk:@MSITStore:E:\9编程宝典\0Programming\Network\Unix+Network+Programmin...
2012-1-11
Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.
Page 4 of 9
Section 9.4. sctp_connectx Function
Section 9.5. sctp_getpaddrs Function
Section 9.6. sctp_freepaddrs Function
Section 9.7. sctp_getladdrs Function
Section 9.8. sctp_freeladdrs Function
Section 9.9. sctp_sendmsg Function
Section 9.10. sctp_recvmsg Function
Section 9.11. sctp_opt_info Function
Section 9.12. sctp_peeloff Function
Section 9.13. shutdown Function
Section 9.14. Notifications
Section 9.15. Summary
Exercises
Chapter 10. SCTP Client/Server Example
Section 10.1. Introduction
Section 10.2. SCTP One-to-Many-Style Streaming Echo Server: main Function
Section 10.3. SCTP One-to-Many-Style Streaming Echo Client: main Function
Section 10.4. SCTP Streaming Echo Client: str_cli Function
Section 10.5. Exploring Head-of-Line Blocking
Section 10.6. Controlling the Number of Streams
Section 10.7. Controlling Termination
Section 10.8. Summary
Exercises
Chapter 11. Name and Address Conversions
Section 11.1. Introduction
Section 11.2. Domain Name System (DNS)
Section 11.3. gethostbyname Function
Section 11.4. gethostbyaddr Function
Section 11.5. getservbyname and getservbyport Functions
Section 11.6. getaddrinfo Function
Section 11.7. gai_strerror Function
Section 11.8. freeaddrinfo Function
Section 11.9. getaddrinfo Function: IPv6
Section 11.10. getaddrinfo Function: Examples
Section 11.11. host_serv Function
Section 11.12. tcp_connect Function
Section 11.13. tcp_listen Function
Section 11.14. udp_client Function
Section 11.15. udp_connect Function
Section 11.16. udp_server Function
Section 11.17. getnameinfo Function
Section 11.18. Re-entrant Functions
Section 11.19. gethostbyname_r and gethostbyaddr_r Functions
Section 11.20. Obsolete IPv6 Address Lookup Functions
Section 11.21. Other Networking Information
Section 11.22. Summary
Exercises
Part 3: Advanced Sockets
Chapter 12. IPv4 and IPv6 Interoperability
Section 12.1. Introduction
Section 12.2. IPv4 Client, IPv6 Server
Section 12.3. IPv6 Client, IPv4 Server
Section 12.4. IPv6 Address-Testing Macros
Section 12.5. Source Code Portability
mk:@MSITStore:E:\9编程宝典\0Programming\Network\Unix+Network+Programmin...
2012-1-11
Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.
Page 5 of 9
Section 12.6. Summary
Exercises
Chapter 13. Daemon Processes and the inetd Superserver
Section 13.1. Introduction
Section 13.2. syslogd Daemon
Section 13.3. syslog Function
Section 13.4. daemon_init Function
Section 13.5. inetd Daemon
Section 13.6. daemon_inetd Function
Section 13.7. Summary
Exercises
Chapter 14. Advanced I/O Functions
Section 14.1. Introduction
Section 14.2. Socket Timeouts
Section 14.3. recv and send Functions
Section 14.4. readv and writev Functions
Section 14.5. recvmsg and sendmsg Functions
Section 14.6. Ancillary Data
Section 14.7. How Much Data Is Queued?
Section 14.8. Sockets and Standard I/O
Section 14.9. Advanced Polling
Section 14.10. Summary
Exercises
Chapter 15. Unix Domain Protocols
Section 15.1. Introduction
Section 15.2. Unix Domain Socket Address Structure
Section 15.3. socketpair Function
Section 15.4. Socket Functions
Section 15.5. Unix Domain Stream Client/Server
Section 15.6. Unix Domain Datagram Client/Server
Section 15.7. Passing Descriptors
Section 15.8. Receiving Sender Credentials
Section 15.9. Summary
Exercises
Chapter 16. Nonblocking I/O
Section 16.1. Introduction
Section 16.2. Nonblocking Reads and Writes: str_cli Function (Revisited)
Section 16.3. Nonblocking connect
Section 16.4. Nonblocking connect: Daytime Client
Section 16.5. Nonblocking connect: Web Client
Section 16.6. Nonblocking accept
Section 16.7. Summary
Exercises
Chapter 17. ioctl Operations
Section 17.1. Introduction
Section 17.2. ioctl Function
Section 17.3. Socket Operations
Section 17.4. File Operations
Section 17.5. Interface Configuration
Section 17.6. get_ifi_info Function
Section 17.7. Interface Operations
Section 17.8. ARP Cache Operations
Section 17.9. Routing Table Operations
Section 17.10. Summary
mk:@MSITStore:E:\9编程宝典\0Programming\Network\Unix+Network+Programmin...
2012-1-11
Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.
Page 6 of 9
Exercises
Chapter 18. Routing Sockets
Section 18.1. Introduction
Section 18.2. Datalink Socket Address Structure
Section 18.3. Reading and Writing
Section 18.4. sysctl Operations
Section 18.5. get_ifi_info Function (Revisited)
Section 18.6. Interface Name and Index Functions
Section 18.7. Summary
Exercises
Chapter 19. Key Management Sockets
Section 19.1. Introduction
Section 19.2. Reading and Writing
Section 19.3. Dumping the Security Association Database (SADB)
Section 19.4. Creating a Static Security Association (SA)
Section 19.5. Dynamically Maintaining SAs
Section 19.6. Summary
Exercises
Chapter 20. Broadcasting
Section 20.1. Introduction
Section 20.2. Broadcast Addresses
Section 20.3. Unicast versus Broadcast
Section 20.4. dg_cli Function Using Broadcasting
Section 20.5. Race Conditions
Section 20.6. Summary
Exercises
Chapter 21. Multicasting
Section 21.1. Introduction
Section 21.2. Multicast Addresses
Section 21.3. Multicasting versus Broadcasting on a LAN
Section 21.4. Multicasting on a WAN
Section 21.5. Source-Specific Multicast
Section 21.6. Multicast Socket Options
Section 21.7. mcast_join and Related Functions
Section 21.8. dg_cli Function Using Multicasting
Section 21.9. Receiving IP Multicast Infrastructure Session Announcements
Section 21.10. Sending and Receiving
Section 21.11. Simple Network Time Protocol (SNTP)
Section 21.12. Summary
Exercises
Chapter 22. Advanced UDP Sockets
Section 22.1. Introduction
Section 22.2. Receiving Flags, Destination IP Address, and Interface Index
Section 22.3. Datagram Truncation
Section 22.4. When to Use UDP Instead of TCP
Section 22.5. Adding Reliability to a UDP Application
Section 22.6. Binding Interface Addresses
Section 22.7. Concurrent UDP Servers
Section 22.8. IPv6 Packet Information
Section 22.9. IPv6 Path MTU Control
Section 22.10. Summary
Exercises
Chapter 23. Advanced SCTP Sockets
Section 23.1. Introduction
mk:@MSITStore:E:\9编程宝典\0Programming\Network\Unix+Network+Programmin...
2012-1-11