Distributed Networks Distributed Networks    Tweet
DBWebApplications eWebProgrammer





Linux Network Administration   «Prev  Next»
Lesson 8 Iterative and Concurrent Servers
Objective Describe the two ways a Server Process may respond to incoming Connections.

Iterative server

A server process may respond to incoming connections in two different ways. The first response pattern looks like this:
  1. The server receives the incoming connection.
  2. The server handles the connection.
  3. The server closes the connection.
  4. The server returns to listening on its well-known port.
A server that operates like this is called an iterative server. When an iterative server is handling a request, other connections to that port are blocked. The incoming connections must be handled one after another. For example, a system in which the telnet server is set up as an iterative server can handle only one incoming telnet connection at a time.
Iterative model
In the Iterative model, the Listener and Server portions of the application coexist in the same CICS or IMS TP and run as part of the same CICS task. The server application, therefore, holds the socket until all application processing has completed. This means that after a client TP starts a server TP, another client TP cannot access the Listener or the server TP until the first client is finished.
How Linux WorksHow Linux Works

Concurrent server
The second type of response pattern looks like this:
  1. The server receives the incoming connection.
  2. The server calls fork() to split itself into two processes, a parent and a child.
  3. The child process handles the connection, while the parent returns to listen on the original port.
  4. When the child process is finished with the connection, it terminates.
A server that operates like this is called a concurrent server. A concurrent server is always available for incoming connections. For example, a system in which the telnet server is set up as a concurrent server can handle multiple telnet connections, each of which is managed by a different child of the listening server process.