A programmer must be extremely careful when optimizing a stateless server because managing small amount of state information can consume resources if clients crash and reboot frequently or if the underlying network duplicates or delays messages. Leave the socket unconnected. Close the connection and exit. The slave process exits after handling all requests from one client. Master Create a socket and bind to the well-known address for the service being offered repeatedly call recvfrom to receive the next request from a client, and create new slave process to handle the response.
Slave receive a specific request upon creation as well as access to the socket.
Create a socket and bind to the well-known address for the service being offered. If some socket other than the original is ready, use read to obtain the next request, form a response, and use write to send the response back to the client. Deadlock is a serious liability in servers, because it means the behavior of one client can prevent the server from handling other clients. During the timeout, TCP keeps a record of the connection so it can correctly reject any old packets that may have been delayed. If clients make repeated requests rapidly, they can use up resources at the server.