Addison Wesley - C++ Network Programming Volume 1.pdf

(5717 KB) Pobierz
22818066 UNPDF
22818066.048.png
Contents
List of Figures
'
'
ix
Foreword
•*
xi
About This Book
xv
Chapter 0
Design Challenges, Middleware Solutions, and ACE
1
0.1
Challenges of Networked Applications
1
0.2
Networked Application Design Dimensions
5
0.3
Object-Oriented Middleware Solutions
7
0.4
An Overview of the ACE Toolkit
12
0.5
Example: A Networked Logging Service
17
0.6
Summary
19
Part I
Object-Oriented Network Programming 21
Chapter 1
Communication Design Dimensions
23
1.1
Connectionless versus Connection-Oriented Protocols
23
1.2
Synchronous versus Asynchronous Message Exchange 26
1.3
Message Passing versus Shared Memory
28
1.4
Summary
31
22818066.049.png 22818066.050.png 22818066.051.png 22818066.001.png
vi
CONTENTS
Chapter 2 An Overview of the Socket API
33
2.1
An Overview of Operating System IPC Mechanisms
33
2.2 The Socket API
34
2.3 Limitations of the Socket API
37
2.4
Summary
43
Chapter 3 The ACE Socket Wrapper Facades
45
3.1
Overview
45
3.2
The ACEJVddr and ACEJNET_Addr Classes
49
3.3
The ACEJPC-SAP Class
52
3.4
The ACE.SOCK Class
54
3.5
The ACEJ3OCK_Connector Class
56
3.6
The ACE_SOCK_IO and ACE_SOCK_Stream Classes
60
3.7
The ACE_SOCKAcceptor Class
64
3.8
Summary
68
Chapter 4
Implementing the Networked Logging Service
71
4.1
Overview
71
4.2
The ACE_Message_Block Class
72
4.3
The ACEJnputCDR and ACE_OutputCDR Classes
76
-
80
4.4
The Initial Logging Server
4.5
The Client Application
95
4.6
Summary
99
Part II Concurrent Object-Oriented Network
Programming
101
Chapter 5
Concurrency Design Dimensions
1O3
5.1
Iterative, Concurrent, and Reactive Servers
103
5.2
Processes versus Threads
109
5.3
Process/Thread Spawning Strategies
112
5.4
User, Kernel, and Hybrid Threading Models
114
5.5
Time-Shared and Real-Time Scheduling Classes
119
5.6
Task-versus Message-Based Architectures
121
5.7
Summary
123
22818066.002.png 22818066.003.png 22818066.004.png 22818066.005.png 22818066.006.png 22818066.007.png 22818066.008.png 22818066.009.png 22818066.010.png 22818066.011.png 22818066.012.png 22818066.013.png 22818066.014.png 22818066.015.png 22818066.016.png 22818066.017.png 22818066.018.png 22818066.019.png 22818066.020.png 22818066.021.png 22818066.022.png 22818066.023.png 22818066.024.png 22818066.025.png 22818066.026.png 22818066.027.png 22818066.028.png 22818066.029.png 22818066.030.png
CONTENTS
Vii
Chapter 6
An Overview of Operating System Concurrency
Mechanisms
125
6.1
Synchronous Event Demultiplexing
125
6.2
Multiprocessing Mechanisms
127
6.3
Multithreading Mechanisms
129
6.4
Synchronization Mechanisms
130
6.5
Limitations with OS Concurrency Mechanisms
135
6.6
Summary
137
Chapter 7
The ACE Synchronous Event Demultiplexing
Wrapper Facades
139
7.1
Overview
139
7.2
The ACE_Handle_Set Class
141
7.3
The ACE_Handle_Set_Iterator Class
147
7.4
The ACE: :select() Methods
151
7.5
Summary
157
Chapter 8 The ACE Process Wrapper Facades
159
8.1
Overview
159
8.2
The ACE_Process Class
161
8.3
The ACE_Process_Options Class
165
8.4
The ACE_Process_Manager Class
169
8.5
Summary
'
182
Chapter 9 The ACE Threading Wrapper Facades
185
9.1
Overview
185
9.2
The ACE_Thread_Manager Class
187
9.3
The ACE_Sched_Params Class
198
9.4
The ACE.TSS Class
201
9.5
Summary
205
Chapter 10 The ACE Synchronization Wrapper Facades
2O7
10.1
Overview
207
10.2
The ACE_Guard Classes
209
10.3
The ACE Mutex Classes
212
10.4
The ACE Readers/Writer Lock Classes
218
10.5
The ACE Semaphore Classes
222
10.6
The ACE Condition Variable Classes
229
10.7
Summary
233
22818066.031.png 22818066.032.png 22818066.033.png 22818066.034.png 22818066.035.png 22818066.036.png 22818066.037.png 22818066.038.png 22818066.039.png 22818066.040.png
Viii
CONTENTS
Appendix A Design Principles for ACE C++ Wrapper Facades
235
A. 1
Overview
235
A. 2
Use Wrapper Facades to Enhance Type Safety
236
A. 3
Simplify for the Common Case
238
A. 4
Use Hierarchies to Enhance Design Clarity and
Extensibility
246
A. 5
Hide Platform Differences Whenever Possible
248
A.6
Optimize for Efficiency
255
A. 7
Summary
257
Appendix B The Past, Present, and Future of ACE
259
B.I
The Evolution of ACE
259
B.2
The Road Ahead
267
B.3
Concluding Remarks
268
Glossary
269
Bibliography
285
Index
295
22818066.041.png 22818066.042.png 22818066.043.png 22818066.044.png 22818066.045.png 22818066.046.png 22818066.047.png
Zgłoś jeśli naruszono regulamin