Examples: Using sendmsg() and recvmsg() APIs to handle incoming connections

The sendmsg() and recvmsg() examples show how to design a server program that uses these APIs to handle incoming connections. When the server starts, it creates a pool of worker jobs. These preallocated (spawned) worker jobs wait until needed. When the client job connects to the server, the server gives the incoming connection to one of the worker jobs.

The following figure illustrates how the server, worker, and client jobs interact when the system uses the sendmsg() and recvmsg() server design.

Server, worker, and client job interaction when you use the sendmsg() and recvmsg() server design


[ Information Center Home Page | Feedback ] [ Legal | AS/400 Glossary ]