Program 7

This program will finally complete the random number server and make it the best one of its kind. Using the code you have been writing, create a server that creates a sub-server for each client, uses pipes to communicate between the sub-server and the server, handles broadcasting by clients to find a server, and finally, handles its IO asynchronously.

The IO for the server includes the broadcast socket and the pipes for communicating with the sub-servers. The sub-server will have the socket to the client, and the pipes to the main server. Carefully craft your server to handle multiple subservers. You need two pipes for each and it has to be easy to access each one so that your select commands and the following logic can easily be associated with any other data for the client. You will see why you need to do this in the next program.

Run at least two servers and four clients and turn in the test runs with your source code.