Distributed Networks Home   Tweet
DBWebApplications eWebProgrammer


Iterative and Concurrent Servers: This page describes the two ways a server process may respond to incoming connections.
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.

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.