实例介绍
UNIX® Network Programming Volume 1, Third Edition: The Sockets Networking, 原文原版,我给其添加了详细的书签:章 -- 节 -- 带粗体标题片段
age Generated by Foxit PDF Creator o Foxit Software http://www.foxitsoftware.comForevaluationonly Team LiB 1 4 PREVIOU NEXT UNIX Network Programming SIW A有 Table of ct UNIXO Network Programming Volume 1, Third Edition: The Sockets Networking API By W. Richard Stevens, Bill Fenner, Andrew M. Rudoff Start Reading Publisher Addison Wesley November 21, 2003 ISBN 0-13-141155-1 Pages 1024 Addison-Wesley Professional Computing Series Foreword Changes from the second edition Using This Book Source Code and Errata Availability. Part 1: Introduction and TcP/ip Chapter 1. Introd Section 11. introductio 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 rchitecture Section 1. 12. Summary xercises Chapter 2, The Transport Layer: TCP, UDP and SCTP Section 2. 1. Introduction Section 2.2. The Big Picture Section 2. 4. Transmission Control Protocol (TCP mk: aMSITStore:E:编程宝典 AOProgramming Network Unix+ Network+ Programmin..2012-1-11 age Generated by Foxit PDF Creator o Foxit Software http:/www.foxitsoftware.comForevaluationonly Section 2.5. Stream Control Transmission Protocol(SCTP) Section 2. 6. TCP Connection Establishment and Termination Section 27. TIME WAIT State Section 2,8. SCTP Association esta blishment and termination Section 2. 9. Port numbers Section 2.10, tcp Port numbers and con current 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, Summa Exercise Chapter 3. Sockets Introduction Section 3. 1. Introducti Section 3. 2. Socket Address structures 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 ton and inet ntop Functions d Related Function s Section 3. 9. read, writen, and readline Functions Section 3.10. Summary Exercises chapter 4. Elementary TCP Sockets Section 4.1, Introduction Section 42. socket function Section 43. connect Function Section 4.4. bind Function Section 4.5, listen function Section 4.6. accept Function Section 4.7. fork and exec functio Section 4.8. Con current servers Section 4.9. close Function Section 4.10. getsockname and getpeername Functions Section 4.11 summa 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 Section5.13.S⊥GP⊥ PE Signal on 5.14. Crashing of Server Host Section 5.15. Crashing and Rebooting of Server Host Section 5.16. Shutdown of server Host mk:@ MSITStore:F:9编程宝典PRogramming NetworkIUnix+ Network+ Programmin.20121-11 Page 3 of 9 Generated by Foxit PDF Creator o Foxit Software http://www.foxitsoftware.comForevaluationonly Section 5.17. Summary of TCP Example Section 5.18, Data format Section 5.19. Summary Exercises Chapter 6. I/0 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 Inout and buffering Section 6.6. shutdown Functi Section 6.7. str cli Function(Revisited Again) Section 6.8. TCP Echo Server(Revisited) cion 6.9. select Function Section 6.10. poll Functi Section 6. 11. TCP Echo Server(Revisited Again Section 6. 12. Summary Exercises Chapter 7. Socket Options Section 7. 2. getsockopt and setsockopt Functions Section 7. 3. Checking if an Option Is Supported and obtaining the Default Section 7 Socket states Section 7.5. Generic Socket Options ection 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, fortI Function Section 7. 12. Summary Section 8. 1. Introduction Section 8.2. recvfrom and sendto Function Section 8, 3. UDP Echo Server: main Function Section 8.4. UDP Echo Server: dc echc Function Section 8.5. UDP Echo Client main Function Section 8.6. UDP Echo Client: dy 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. dy 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. Summar Exercises Chapter 9. Elementary SCTP Socket Section 9. 1. Introduction Section 9.2. Interface models Section 93. sctp bind Function mk:@ MSITStore:F:9编程宝典PRogramming NetworkIUnix+ Network+ Programmin.20121-11 Page 4 of 9 Generated by Foxit PDF Creator Foxit Software http://www.foxitsoftware.comForevaluationonly Section 9. 4. sctp connectx Function Section 9.5. sctp getpaddrs Function Section 9.6. sctp freepaddrs Function Section 9. 7. sct retladdrs Function Section 9.8. sctp freeladdrs Function Section 9.9. sctp sendmsc 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. Summar 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 cliFunction 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 Chapter 11. Name and Address Conversions ection 11.1. Introduc Domain Name system (dN Section 11.4. gethosthyaddr 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. getaddrinto 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. getname: Section 11.18. Re-entrant functions Section 11.19 gethostbyname r and gethosth dr r Functions Section 11.20. Obsolete IPv6 Address Lookup Functions Section 11.21. other Networking Information Section 1122. summa Exercises Part 3: Advanced sockets Chapter 12. IPv4 and IPv6 Interopera bility Section 12.1. Introduction Section 12.2 IPv 4 client, ipy6 seryer Section 12.3. IPv6 Client, IPv4 Server Section 12.4. IPv6 Address-Testing Macros Section 12.5. Source Code Portability mk:@ MSITStore:F:9编程宝典PRogramming NetworkIUnix+ Network+ Programmin.20121-11 Page 5 of 9 Generated by Foxit PDF Creator o Foxit Software http:/www.foxitsoftware.comForevaluationonly Section 12.6. Summary 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 143. recv and senc functions Section 14.4. ready 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. Summar 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./. Summary 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:F:9编程宝典PRogramming NetworkIUnix+ Network+ Programmin.20121-11 Page 6 of 9 Generated by Foxit PDF Creator o Foxit Software http://www.foxitsoftware.comForevaluationonly xercises Chapter 18. Routing sockets Section 18.1, Introduction Section 18.2 Datalink socket address structure Section 18.3. Reading and Writing lerations Section 18.5 fi info Function(R Section 18.6. Interface name and index functions Section 18.7 Summa 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) ection. 4, Creating a Static Security Association(SA Section 19.5. Dynamically Maintaining sAs Section 19.6. S Chapter 20. Broadcasting Section 20. 1. Introduction Section 20.2 broadcast addresses Section 203. Unicast versus broad cast Section 20.4. dg cli Function Using Broadcasting Section 20. 5. Race conditions Section 20.6. Summary Exercises Chapter之 Section 21. 1. Introduction Section 212. 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 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:F:9编程宝典PRogramming NetworkIUnix+ Network+ Programmin.20121-11 Page 7 of 9 Generated by Foxit PDF Creator o Foxit Software http:/www.foxitsoftware.comForevaluationonly Section 23.2. An Autoclosing one-to-Many-Style server Section 23.3. Partial Delivery Section 23. 4, Notifications Section 23.5. Unordered data Section 23. 6. Binding a Subset of Addresses Section 23. 7. Determining Peer and Local Address Information Section 23. 8. Finding an Association ID Given an IP Addres Section 23. 9. Heartbeating and Address Failure Section 23. 10. Peeling off an Association Section 23. 11. Controlling Timi Section 23.12. when to use sctp instead of tcp Section 23.13. Summar Exe Chapter 24. Out-of-Band Data Section 24.2. Tcp out-of-Band data Section 24.3, sockatmark Function Section 24. 4. TCP Out-of-Band Data Recap Section 24.5. S Exercises I/O Section 25.2. Signal-Driven Io for Sockets Section 25.3. UDP Echo Server Using SIGIO Section 25. 4. Summary Chapter 26. Threads Section 26. 1 Introduction Section 26.2. Basic thread Functions Creation and termination Section 26.3. s-r cli Function Using Threads Section 26. 4. TCP Echo Server Using Threads Section 26.5. Thread-Specific Data Section 26.6. Web Client and Simultaneous Connections( Continued). Section 26.7, Mutexes Mutual Exclusion Section 26. 8. Condition variables Section 26. 10. Summary chapter 27. IP Options Section 27. 1 introduction Section 27. 2. IPv4 Options Section 27.3. IPv4 Source Route Options Section 27, 4 iPy6 Extension headers Section 27.5. IPv6 Hop-by-Hop Options and Destination Options Section 27.6, IPv6 Routing header Section 27.7. IPv6 Sticky Options Section 27. 8. Historical ipv6 Advanced api Section 27.9. Summary E Chapter 28. Raw Sockets Section 28. 1. Introductio Section 2 Raw socket creation Section 28.3. Raw Socket Output Section 28. 4. Raw Socket Input mk:@ MSITStore:F:9编程宝典PRogramming NetworkIUnix+ Network+ Programmin.20121-11 Page 8 of 9 Generated by Foxit PDF Creator o Foxit Software http://www.foxitsoftware.comForevaluationonly Section 28.5 piI.g Program Section 28.6. traceroute program Section 28.7. An ICMP Message Daemon Section 28.8. Summary Exercises Chapter 29. Datalink Access Section 29.1. Introduction Section 29.2. BSD Packet Filter(BPF 29,3. Datalink Provider Interface(DLPII Section 29.4, Linux: SocK paCket and PF PACKet Section 29.5. libpcap: Packet Capture Library Section 29.6. libnet: Packet Creation and Injection Library Section 29.7. Examining the UDP Checksum Field Section 29. 8. Summary Chapter 30. Client/server Design Alternatives Section 30. 1. Introduction Section 302, TCP Client alternatives on 30.3, TCP Test client Section 30. 4. TCP Iterative server Section 30.5, TCP Concurrent Server, One Child per Client Section 30.6. TCP Preforked Server, No Locking Around accept Section 30.7. TCP Preforked Server, File Locking Around accept Section 30.8. TCP Preforked Server, Thread Locking Around accept Section 30.9. TCP Preforked Server, Descriptor Passin Section 30. 10. TCP Concurrent Server, One Thread per Client Section 30.11. TCP Prethreaded Server, per-Thread accept Section 30. 12. TCP Prethreaded Server, Main Thread accept Section 30 13. Summary Exercise Chapter 31. Streams Section 31. 1. Introduction Section 312. overview Section 31.3. getmsg and putmsg Functions Section 31. 4. ge tpms and putomsg functions Section 31.5, ioctl Function Section 31. 6. Transport Provider Interface(TPI Section 31.7. Summary Exercises Appendix A. IPv4, IPv6, ICMPv4, and ICMPv6 Section A, 1. Introduction Section A.2. IPv4 Header Section A, 4. IPv4 Addresses Section A. 5. iPv6 Addresses Section A. 6. Internet Control Message Protocols (ICMPy4 and ICMPv6 Appendix B. Vi Section b. 1 introduction Section b, 2. the mbone Section b 3. The 6bone Section b 4. IPv6 transition: 6to4 Appendix C. Debugging Techniques Section C 1. System Call tracing Section C 2. Standard Internet services mk:@ MSITStore:F:9编程宝典PRogramming NetworkIUnix+ Network+ Programmin.20121-11 【实例截图】
【核心代码】
标签:
小贴士
感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。
- 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
- 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
- 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
- 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。
关于好例子网
本站旨在为广大IT学习爱好者提供一个非营利性互相学习交流分享平台。本站所有资源都可以被免费获取学习研究。本站资源来自网友分享,对搜索内容的合法性不具有预见性、识别性、控制性,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,平台无法对用户传输的作品、信息、内容的权属或合法性、安全性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论平台是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二与二十三条之规定,若资源存在侵权或相关问题请联系本站客服人员,点此联系我们。关于更多版权及免责申明参见 版权及免责申明
网友评论
我要评论