threaded server


The following is a servers that implements an "add service". A client sends a request to add two numbers, and the server returns the sum. The server spawns a new thread for each client, and uses pthread_detach to detach the thread so that the thread does not have to be joined.

threaded.c


      

Additional files: