没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
Contents
1 Introduction And Overview.......................................................................................1
1.1 Use Of TCP/IP..........................................................................................1
1.2 Designing Applications For A Distributed Environment...........................2
1.3 Standard And Nonstandard Application Protocols....................................2
1.4 An Example Of Standard Application Protocol Use.................................2
1.5 An Example Connection...........................................................................3
1.6 Using TELNET To Access An Alternative Service...................................4
1.7 Application Protocols And Software Flexibility.......................................5
1.8 Viewing Services From The Provider's Perspective..................................6
1.9 The Remainder Of The Text......................................................................7
1.10 Summary...................................................................................................7
1.11 FOR FURTHER STUDY..........................................................................7
1.12 EXERCISES.............................................................................................8
2 The Client Server Model And Software Design........................................................9
2.1 Introduction...............................................................................................9
2.2 Motivation.................................................................................................9
2.3 Terminology And Concepts.....................................................................10
2.3.1 Clients And Servers.........................................................................10
2.3.2 Privilege And Complexity...............................................................11
2.3.3 Standard Vs. Nonstandard Client Software.....................................11
2.3.4 Parameterization Of Clients............................................................12
2.3.5 Connectionless Vs. Connection-Oriented Servers...........................13
2.3.6 Stateless Vs. Stateful Servers..........................................................14
2.3.7 A Stateful File Server Example.......................................................15
2.3.8 Statelessness Is A Protocol Issue.....................................................17
2.3.9 Servers As Clients...........................................................................17
2.4 Summary.................................................................................................18
2.5 FOR FURTHER STUDY........................................................................19
2.6 EXERCISES...........................................................................................19
3 Concurrent Processing In Client-Server Software..................................................20
3.1 Introduction.............................................................................................20
3.2 Concurrency In Networks.......................................................................20
3.3 Concurrency In Servers...........................................................................22
3.4 Terminology And Concepts.....................................................................23
3.4.1 The Process Concept.......................................................................23
3.4.2 Threads............................................................................................24
3.4.3 Programs vs. Threads......................................................................25
3.4.4 Procedure Calls...............................................................................25
3.5 An Example Of Concurrent Thread Creation..........................................26
3.5.1 A Sequential C Example..................................................................26
3.5.2 A Concurrent Version......................................................................27
3.5.3 Timeslicing......................................................................................29
3.6 Diverging Threads...................................................................................30
3.7 Context Switching And Protocol Software Design.................................31
3.8 Concurrency And Asynchronous I/O......................................................31
3.9 Concurrency Under UNIX......................................................................32
3.10 Executing A Separately Compiled Program............................................34
3.11 Summary.................................................................................................34
3.12 FOR FURTHER STUDY........................................................................35
3.13 EXERCISES...........................................................................................35
4 Program Interface To Protocols...............................................................................36
4.1 Introduction.............................................................................................36
4.2 Loosely Specified Protocol Software Interface.......................................36
4.2.1 Advantages And Disadvantages......................................................37
4.3 Interface Functionality............................................................................37
4.4 Conceptual Interface Specification.........................................................38
4.5 Implementation Of An API.....................................................................38
4.6 Two Basic Approaches To Network Communication.............................40
4.7 The Basic I/O Functions Available In ANSI C........................................41
4.8 History Of The UNIX Socket API..........................................................42
4.9 Summary.................................................................................................42
4.10 FOR FURTHER STUDY........................................................................43
4.11 EXERCISES...........................................................................................43
5 The Socket API.......................................................................................................45
5.1 Introduction.............................................................................................45
5.2 The History Of Sockets...........................................................................45
5.3 Specifying A Protocol Interface..............................................................46
5.4 The Socket Abstraction...........................................................................47
5.4.1 Socket Descriptors...........................................................................47
5.4.2 System Data Structures For Sockets................................................48
5.4.3 Using Sockets..................................................................................48
5.5 Specifying An Endpoint Address............................................................49
5.6 A Generic Address Structure...................................................................49
5.7 Functions In The Socket API...................................................................51
5.7.1 The WSAStartup Function..............................................................51
5.7.2 The WSACIeanup Function............................................................52
5.7.3 The Socket Function........................................................................52
5.7.4 The Connect Function.....................................................................52
5.7.5 The Send Function..........................................................................52
5.7.6 The Recv Function..........................................................................52
5.7.7 The Closesocket Function...............................................................53
5.7.8 The Bind Function...........................................................................53
5.7.9 The Listen Function........................................................................53
5.7.10 The Accept Function.......................................................................54
5.7.11 Summary Of Socket Calls Used With TCP.....................................54
5.8 Utility Routines For Integer Conversion.................................................54
5.9 Using Socket Calls In A Program............................................................55
5.10 Symbolic Constants For Socket Call Parameters....................................56
5.11 Summary.................................................................................................57
5.12 FOR FURTHER STUDY........................................................................58
5.13 EXERCISES...........................................................................................58
6 Algorithms And Issues In Client Software Design.................................................59
6.1 Introduction.............................................................................................59
6.2 Learning Algorithms Instead Of Details.................................................59
6.3 Client Architecture..................................................................................60
6.4 Identifying The Location Of A Server.....................................................60
6.5 Parsing An Address Argument................................................................62
6.6 Looking Up A Domain Name..................................................................63
6.7 Looking Up A Well-Known Port By Name.............................................64
6.8 Port Numbers And Network Byte Order.................................................64
6.9 Looking Up A Protocol By Name...........................................................64
6.10 The TCP Client Algorithm......................................................................65
6.11 Allocating A Socket.................................................................................66
6.12 Choosing A Local Protocol Port Number................................................66
6.13 A Fundamental Problem In Choosing A Local IP Address......................66
6.14 Connecting A TCP Socket To A Server...................................................67
6.15 Communicating With The Server Using TCP.........................................68
6.16 Reading A Response From A TCP Connection.......................................69
6.17 Closing A TCP Connection.....................................................................69
6.17.1 The Need For Partial Close.............................................................69
6.17.2 A Partial Close Operation................................................................70
6.18 Programming A UDP Client....................................................................70
6.19 Connected And Unconnected UDP Sockets............................................71
6.20 Using Connect With UDP.......................................................................71
6.21 Communicating With A Server Using UDP............................................71
6.22 Closing A Socket That Uses UDP...........................................................72
6.23 Partial Close For UDP.............................................................................72
6.24 A Warning About UDP Unreliability.......................................................72
6.25 Summary.................................................................................................73
6.26 FOR FURTHER STUDY........................................................................73
6.27 EXERCISES...........................................................................................73
7 Example Client Software........................................................................................75
7.1 Introduction.............................................................................................75
7.2 The Importance Of Small Examples.......................................................75
7.3 Hiding Details.........................................................................................76
7.4 An Example Procedure Library For Client Programs.............................76
7.5 Implementation Of ConTCP...................................................................77
7.6 Implementation Of ConUDP...................................................................77
7.7 A Procedure That Forms Connections.....................................................78
7.8 Using The Example Library....................................................................81
7.9 The DAYTIME Service...........................................................................81
7.10 Implementation Of A TCP Client For DAYTIME...................................82
7.11 Reading From A TCP Connection...........................................................83
7.12 The TIME Service...................................................................................84
7.13 Accessing The TIME Service..................................................................85
7.14 Accurate Times And Network Delays.....................................................85
7.15 A UDP Client For The TIME Service.....................................................85
7.16 The ECHO Service..................................................................................88
7.17 A TCP Client For The ECHO Service.....................................................88
7.18 A UDP Client For The ECHO Service....................................................90
7.19 Summary.................................................................................................92
7.20 FOR FURTHER STUDY........................................................................92
7.21 EXERCISES...........................................................................................93
8 Algorithms And Issues In Server Software Design.................................................95
8.1 Introduction.............................................................................................95
8.2 The Conceptual Server Algorithm...........................................................95
8.3 Concurrent Vs. Iterative Servers.............................................................96
8.4 Connection-Oriented Vs. Connectionless Access...................................96
8.5 Connection-Oriented Servers..................................................................97
8.6 Connectionless Servers...........................................................................98
8.7 Failure, Reliability, And Statelessness.....................................................98
8.8 Optimizing Stateless Servers...................................................................99
8.9 Four Basic Types Of Servers.................................................................101
8.10 Request Processing Time......................................................................102
8.11 Iterative Server Algorithms...................................................................102
8.12 An Iterative, Connection-Oriented Server Algorithm...........................102
8.13 Binding To A Well-Known Address Using INADDR_ANY.................103
8.14 Placing The Socket In Passive Mode....................................................104
8.15 Accepting Connections And Using Them.............................................104
8.16 An Iterative, Connectionless Server Algorithm.....................................104
8.17 Forming A Reply Address In A Connectionless Server.........................104
8.18 Concurrent Server Algorithms..............................................................105
8.19 Master And Slave Threads....................................................................106
8.20 A Concurrent, Connectionless Server Algorithm..................................106
8.21 A Concurrent, Connection-Oriented Server Algorithm.........................107
8.22 Using Separate Programs As Slaves......................................................108
8.23 Apparent Concurrency Using A Single Thread.....................................108
8.24 When To Use Each Server Type............................................................109
8.25 A Summary of Server Types.................................................................110
8.26 The Important Problem Of Server Deadlock.........................................111
8.27 Alternative Implementations.................................................................112
8.28 Summary...............................................................................................112
8.29 FOR FURTHER STUDY......................................................................112
8.30 EXERCISES.........................................................................................112
9 Iterative, Connectionless Servers (UDP)..............................................................114
9.1 Introduction...........................................................................................114
9.2 Creating A Passive Socket.....................................................................114
9.3 Thread Structure....................................................................................117
9.4 An Example TIME Server.....................................................................118
9.5 Summary...............................................................................................120
9.6 FOR FURTHER STUDY......................................................................120
9.7 EXERCISES.........................................................................................121
10 Iterative, Connection-Oriented Servers (TCP)..............................................122
剩余444页未读,继续阅读
资源评论
zz350933415
- 粉丝: 0
- 资源: 6
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 使用SpringBoot2.x 简单实现Java高并发之秒杀系统
- 基于python+opencv实现的手指静脉识别源码+数据集+项目说明毕业设计.zip
- Android AIDL基础-利用AIDL实现客户端向服务端传递Listener接口
- Android AIDL基础-利用AIDL实现客户端向服务端传递基本类型
- GHKQ-12.ass
- Android图像介绍-Bitmap常用操作
- 基于matlab实现的量化因子选股模型示例,包含数据读取、因子筛选、因子分类和回测部分.rar
- 基于matlab实现的粒子群算法,也称粒子群优化算法(Particle Swarm Optimization),.rar
- 基于matlab实现的利用数论中的佳点集的理论和方法
- 基于matlab实现的利用鲍威尔发求解的优化算法.rar
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功