没有合适的资源?快使用搜索试试~ 我知道了~
首页Unix网络编程英文版PDF
Unix网络编程英文版PDF
需积分: 50 31 下载量 141 浏览量
更新于2023-05-22
评论
收藏 9.41MB PDF 举报
Unix网络编程英文版PDF,学习Unix网络编程必不可少的书籍。英文版结合中文版一起学习效果更好
资源详情
资源评论
资源推荐
Addison Wesley : UNIX
Network Programming
Volume 1, Third Edition: The
Sockets Networking API
Addison Wesley : UNIX Network Programming Volume 1, Third Edition: The Sockets Networking API
1
Table Of Contents
1. Main Page ...................................................................................................................................... 12
2. Table of content ............................................................................................................................. 13
3. Copyright ....................................................................................................................................... 23
4. Addison-Wesley Professional Computing Series ............................................................................ 25
5. Foreword........................................................................................................................................ 27
6. Preface ........................................................................................................................................... 28
6.1 Introduction ......................................................................................................................... 28
6.2 Changes from the Second Edition ........................................................................................ 29
6.3 Using This Book .................................................................................................................... 30
6.4 Source Code and Errata Availability ..................................................................................... 30
6.5 Acknowledgments ............................................................................................................... 31
7. Part 1: Introduction and TCP/IP ..................................................................................................... 32
7.1 Chapter 1. Introduction ....................................................................................................... 32
7.1.1 1.1 Introduction ........................................................................................................ 33
7.1.2 1.2 A Simple Daytime Client ..................................................................................... 36
7.1.3 1.3 Protocol Independence ....................................................................................... 41
7.1.4 1.4 Error Handling: Wrapper Functions .................................................................... 42
7.1.5 1.5 A Simple Daytime Server .................................................................................... 45
7.1.6 1.6 Roadmap to Client/Server Examples in the Text ................................................. 49
7.1.7 1.7 OSI Model ........................................................................................................... 51
7.1.8 1.8 BSD Networking History ...................................................................................... 52
7.1.9 1.9 Test Networks and Hosts ..................................................................................... 54
7.1.10 1.10 Unix Standards ................................................................................................ 60
7.1.11 1.11 64-Bit Architectures ........................................................................................ 63
7.1.12 1.12 Summary ......................................................................................................... 64
7.1.13 Exercises .................................................................................................................. 65
7.2 Chapter 2. The Transport Layer: TCP, UDP, and SCTP ........................................................... 66
7.2.1 2.1 Introduction ........................................................................................................ 66
7.2.2 2.2 The Big Picture .................................................................................................... 67
7.2.3 2.3 User Datagram Protocol (UDP) ........................................................................... 70
7.2.4 2.4 Transmission Control Protocol (TCP) ................................................................... 71
7.2.5 2.5 Stream Control Transmission Protocol (SCTP) .................................................... 72
7.2.6 2.6 TCP Connection Establishment and Termination ................................................ 73
7.2.7 2.7 TIME_WAIT State ................................................................................................ 80
7.2.8 2.8 SCTP Association Establishment and Termination .............................................. 82
7.2.9 2.9 Port Numbers ...................................................................................................... 87
7.2.10 2.10 TCP Port Numbers and Concurrent Servers .................................................... 90
7.2.11 2.11 Buffer Sizes and Limitations ............................................................................ 92
7.2.12 2.12 Standard Internet Services .............................................................................. 99
7.2.13 2.13 Protocol Usage by Common Internet Applications ....................................... 100
Addison Wesley : UNIX Network Programming Volume 1, Third Edition: The Sockets Networking API
2
7.2.14 2.14 Summary ....................................................................................................... 101
7.2.15 Exercises ................................................................................................................ 102
8. Part 2: Elementary Sockets .......................................................................................................... 103
8.1 Chapter 3. Sockets Introduction ........................................................................................ 103
8.1.1 3.1 Introduction ...................................................................................................... 104
8.1.2 3.2 Socket Address Structures ................................................................................ 104
8.1.3 3.3 Value-Result Arguments .................................................................................... 112
8.1.4 3.4 Byte Ordering Functions ................................................................................... 115
8.1.5 3.5 Byte Manipulation Functions ............................................................................ 119
8.1.6 3.6 'inet_aton', 'inet_addr', and 'inet_ntoa' Functions ........................................... 121
8.1.7 3.7 'inet_pton' and 'inet_ntop' Functions............................................................... 122
8.1.8 3.8 'sock_ntop' and Related Functions ................................................................... 125
8.1.9 3.9 'readn', 'writen', and 'readline' Functions......................................................... 128
8.1.10 3.10 Summary ....................................................................................................... 134
8.1.11 Exercises ................................................................................................................ 135
8.2 Chapter 4. Elementary TCP Sockets ................................................................................... 135
8.2.1 4.1 Introduction ...................................................................................................... 136
8.2.2 4.2 'socket' Function ............................................................................................... 137
8.2.3 4.3 'connect' Function ............................................................................................ 140
8.2.4 4.4 'bind' Function .................................................................................................. 143
8.2.5 4.5 'listen' Function ................................................................................................. 146
8.2.6 4.6 'accept' Function ............................................................................................... 152
8.2.7 4.7 'fork' and 'exec' Functions................................................................................. 156
8.2.8 4.8 Concurrent Servers ........................................................................................... 158
8.2.9 4.9 'close' Function ................................................................................................. 161
8.2.10 4.10 'getsockname' and 'getpeername' Functions ............................................... 162
8.2.11 4.11 Summary ....................................................................................................... 165
8.2.12 Exercises ................................................................................................................ 165
8.3 Chapter 5. TCP Client/Server Example ............................................................................... 166
8.3.1 5.1 Introduction ...................................................................................................... 167
8.3.2 5.2 TCP Echo Server: 'main' Function ..................................................................... 168
8.3.3 5.3 TCP Echo Server: 'str_echo' Function ............................................................... 170
8.3.4 5.4 TCP Echo Client: 'main' Function ...................................................................... 170
8.3.5 5.5 TCP Echo Client: 'str_cli' Function ..................................................................... 171
8.3.6 5.6 Normal Startup ................................................................................................. 172
8.3.7 5.7 Normal Termination .......................................................................................... 175
8.3.8 5.8 POSIX Signal Handling ....................................................................................... 177
8.3.9 5.9 Handling 'SIGCHLD' Signals ............................................................................... 181
8.3.10 5.10 'wait' and 'waitpid' Functions ....................................................................... 184
8.3.11 5.11 Connection Abort before 'accept' Returns ................................................... 190
8.3.12 5.12 Termination of Server Process ...................................................................... 191
8.3.13 5.13 'SIGPIPE' Signal.............................................................................................. 193
8.3.14 5.14 Crashing of Server Host................................................................................. 195
8.3.15 5.15 Crashing and Rebooting of Server Host ........................................................ 196
Addison Wesley : UNIX Network Programming Volume 1, Third Edition: The Sockets Networking API
3
8.3.16 5.16 Shutdown of Server Host .............................................................................. 197
8.3.17 5.17 Summary of TCP Example ............................................................................. 197
8.3.18 5.18 Data Format .................................................................................................. 199
8.3.19 5.19 Summary ....................................................................................................... 203
8.3.20 Exercises ................................................................................................................ 204
8.4 Chapter 6. I/O Multiplexing: The 'select' and 'poll' Functions ........................................... 205
8.4.1 6.1 Introduction ...................................................................................................... 206
8.4.2 6.2 I/O Models ........................................................................................................ 207
8.4.3 6.3 'select' Function ................................................................................................ 213
8.4.4 6.4 'str_cli' Function (Revisited) .............................................................................. 220
8.4.5 6.5 Batch Input and Buffering ................................................................................. 223
8.4.6 6.6 'shutdown' Function ......................................................................................... 226
8.4.7 6.7 'str_cli' Function (Revisited Again) .................................................................... 228
8.4.8 6.8 TCP Echo Server (Revisited) .............................................................................. 230
8.4.9 6.9 'pselect' Function .............................................................................................. 236
8.4.10 6.10 'poll' Function ............................................................................................... 238
8.4.11 6.11 TCP Echo Server (Revisited Again) ................................................................ 241
8.4.12 6.12 Summary ....................................................................................................... 244
8.4.13 Exercises ................................................................................................................ 245
8.5 Chapter 7. Socket Options ................................................................................................. 246
8.5.1 7.1 Introduction ...................................................................................................... 246
8.5.2 7.2 'getsockopt' and 'setsockopt' Functions ........................................................... 247
8.5.3 7.3 Checking if an Option Is Supported and Obtaining the Default ........................ 249
8.5.4 7.4 Socket States ..................................................................................................... 254
8.5.5 7.5 Generic Socket Options ..................................................................................... 255
8.5.6 7.6 IPv4 Socket Options .......................................................................................... 271
8.5.7 7.7 ICMPv6 Socket Option ...................................................................................... 273
8.5.8 7.8 IPv6 Socket Options .......................................................................................... 273
8.5.9 7.9 TCP Socket Options ........................................................................................... 276
8.5.10 7.10 SCTP Socket Options ..................................................................................... 279
8.5.11 7.11 'fcntl' Function .............................................................................................. 292
8.5.12 7.12 Summary ....................................................................................................... 295
8.5.13 Exercises ................................................................................................................ 296
8.6 Chapter 8. Elementary UDP Sockets .................................................................................. 298
8.6.1 8.1 Introduction ...................................................................................................... 299
8.6.2 8.2 'recvfrom' and 'sendto' Functions .................................................................... 300
8.6.3 8.3 UDP Echo Server: 'main' Function .................................................................... 301
8.6.4 8.4 UDP Echo Server: 'dg_echo' Function ............................................................... 302
8.6.5 8.5 UDP Echo Client: 'main' Function ..................................................................... 304
8.6.6 8.6 UDP Echo Client: 'dg_cli' Function .................................................................... 305
8.6.7 8.7 Lost Datagrams ................................................................................................. 306
8.6.8 8.8 Verifying Received Response ............................................................................ 307
8.6.9 8.9 Server Not Running ........................................................................................... 310
8.6.10 8.10 Summary of UDP Example ............................................................................ 312
Addison Wesley : UNIX Network Programming Volume 1, Third Edition: The Sockets Networking API
4
8.6.11 8.11 'connect' Function with UDP ........................................................................ 314
8.6.12 8.12 'dg_cli' Function (Revisited) .......................................................................... 318
8.6.13 8.13 Lack of Flow Control with UDP ..................................................................... 320
8.6.14 8.14 Determining Outgoing Interface with UDP ................................................... 324
8.6.15 8.15 TCP and UDP Echo Server Using 'select' ....................................................... 326
8.6.16 8.16 Summary ....................................................................................................... 329
8.6.17 Exercises ................................................................................................................ 329
8.7 Chapter 9. Elementary SCTP Sockets ................................................................................. 330
8.7.1 9.1 Introduction ...................................................................................................... 331
8.7.2 9.2 Interface Models ............................................................................................... 332
8.7.3 9.3 'sctp_bindx' Function ........................................................................................ 337
8.7.4 9.4 'sctp_connectx' Function .................................................................................. 338
8.7.5 9.5 'sctp_getpaddrs' Function ................................................................................. 339
8.7.6 9.6 'sctp_freepaddrs' Function ............................................................................... 339
8.7.7 9.7 'sctp_getladdrs' Function .................................................................................. 340
8.7.8 9.8 'sctp_freeladdrs' Function ................................................................................ 340
8.7.9 9.9 'sctp_sendmsg' Function .................................................................................. 341
8.7.10 9.10 'sctp_recvmsg' Function ............................................................................... 342
8.7.11 9.11 'sctp_opt_info' Function ............................................................................... 342
8.7.12 9.12 'sctp_peeloff' Function ................................................................................. 343
8.7.13 9.13 'shutdown' Function ..................................................................................... 343
8.7.14 9.14 Notifications .................................................................................................. 344
8.7.15 9.15 Summary ....................................................................................................... 352
8.7.16 Exercises ................................................................................................................ 352
8.8 Chapter 10. SCTP Client/Server Example ........................................................................... 353
8.8.1 10.1 Introduction .................................................................................................... 353
8.8.2 10.2 SCTP One-to-Many-Style Streaming Echo Server: 'main' Function ................. 354
8.8.3 10.3 SCTP One-to-Many-Style Streaming Echo Client: 'main' Function .................. 357
8.8.4 10.4 SCTP Streaming Echo Client: 'str_cli' Function................................................ 359
8.8.5 10.5 Exploring Head-of-Line Blocking ..................................................................... 361
8.8.6 10.6 Controlling the Number of Streams ................................................................ 368
8.8.7 10.7 Controlling Termination .................................................................................. 369
8.8.8 10.8 Summary ......................................................................................................... 371
8.8.9 Exercises .................................................................................................................. 371
8.9 Chapter 11. Name and Address Conversions ..................................................................... 372
8.9.1 11.1 Introduction .................................................................................................... 373
8.9.2 11.2 Domain Name System (DNS) .......................................................................... 374
8.9.3 11.3 'gethostbyname' Function .............................................................................. 378
8.9.4 11.4 'gethostbyaddr' Function ................................................................................ 383
8.9.5 11.5 'getservbyname' and 'getservbyport' Functions ............................................. 383
8.9.6 11.6 'getaddrinfo' Function ..................................................................................... 389
8.9.7 11.7 'gai_strerror' Function .................................................................................... 395
8.9.8 11.8 'freeaddrinfo' Function ................................................................................... 396
8.9.9 11.9 'getaddrinfo' Function: IPv6 ............................................................................ 396
剩余1139页未读,继续阅读
bravemanzhou
- 粉丝: 3
- 资源: 9
上传资源 快速赚钱
- 我的内容管理 收起
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
会员权益专享
最新资源
- zigbee-cluster-library-specification
- JSBSim Reference Manual
- c++校园超市商品信息管理系统课程设计说明书(含源代码) (2).pdf
- 建筑供配电系统相关课件.pptx
- 企业管理规章制度及管理模式.doc
- vb打开摄像头.doc
- 云计算-可信计算中认证协议改进方案.pdf
- [详细完整版]单片机编程4.ppt
- c语言常用算法.pdf
- c++经典程序代码大全.pdf
- 单片机数字时钟资料.doc
- 11项目管理前沿1.0.pptx
- 基于ssm的“魅力”繁峙宣传网站的设计与实现论文.doc
- 智慧交通综合解决方案.pptx
- 建筑防潮设计-PowerPointPresentati.pptx
- SPC统计过程控制程序.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0