Passing sockets in a concurrent server program

This topic contains concepts and tasks information about passing sockets.

Common interface concepts

To help you better understand socket passing, the following topics explain common interface concepts.

A server handling more than one client simultaneously acts like a dispatcher at a messenger service. A messenger dispatcher gets telephone calls from people who want items delivered, and the dispatcher sends out messengers to do the work. In a similar manner, the server receives client requests, and then spawns tasks to handle each client.

Tasks can pass sockets with the givesocket() and takesocket() calls. The task passing the socket uses givesocket(), and the task receiving the socket uses takesocket(). The following topics describe these processes.