forking server


The following is two servers that implement an "add service". A client sends a request to add two numbers, and the server returns the sum. The first server is iterative: it handles clients serially, one at a time. The second server forks a child process to service each new client, so that the server can handle multiple clients concurrently.

iterative.c
An iterative "add" server
forking.c
A forking "add" server
client.c
The "add" client
multi_client.c
Forks a specified number of clients which simultaneously make queries

The complete source code and Makefile is available as a zip file.

iterative.c


      
forking.c


      
client.c


      
multi_client.c