文档介绍:Chapter 4: Server Software Design Chapter 4: Server Software Design
Chapter goal: Chapter goal:
Algorithm and issues Algorithm and issues
Iterative servers Iterative servers
Concurrent, connection-oriented Concurrent, connection-oriented
servers servers
Singly-threaded, concurrent Singly-threaded, concurrent
servers servers
Multiprotocol servers Multiprotocol servers
Multiservice servers Multiservice servers
Uniform, efficient management Uniform, efficient management
of server concurrency of server concurrency
哈工大计算机学院 work Application Development Server Software Design 1 哈工大计算机学院 work Application Development Server Software Design 2
Concurrent vs. Iterative
The conceptual server algorithm Servers
Each server follows a simple algorithm: Iterative server
Creates a socket Process one request at a time
Binds port Unnecessary delays
Enters infinite loop Easier to build
Accepts request Poor performance
Processes request Concurrent server
Responses Handles multiple requests at one time
But only suffices for only the most trivial More difficult to design and build
services Better performance
哈工大计算机学院 work Application Development Server Software Design 3 哈工大计算机学院 work Application Development Server Software Design 4
Connection-oriented vs. Connection-oriented vs.
Connectionless Servers Connectionless Servers
Depend on the application protocol Connectionless servers
Connection-oriented servers Advantages:
Do not suffer from the problem of resource
Advantages:
depletion
Ease of programming
Can supply broadcast or munication
TCP provides reliability
Disadvantages:
Disadvantages:
Can not depend on underlying transport for
Require a separate socket for each connection reliable delivery
Overhead of 3-way handshaking
Application protocols respond for reliability
TCP does not send any packets over an idl