This project is to simulate a system with four temperature servers and a client which retrieves and displays each servers temperature information.
Each temperature server should send a string to the client indicating its location and the current temperature. The information supplied by the server does not have to be real. Each server can set an arbitrary place name as its location string. When a temperature reading is requested, the server returns its location string and a string representing the current temperature (or you could also send a number value). The temperature can be a random number.
Your servers should respond to two kinds of messages from your client: temperature request and stop. The server quits after receiving a stop message.
The client simply sends a temperature request message to each server in a round robin fashions for some number of cycles. Then, the client sends the stop message to terminate each server, then the client terminates. You should add random delays between each server request in order to make your system realistic. Your client should access four termperature servers. Each server should listen on an individual port. For example, you can use ports 4444, 5555, 6666, and 7777 for your four server instances.
You must use internet UDP sockets for project but you do not have to communicate across machines all processing can be done on the same machine (i.e., all your servers and client can reside on the same machine.) You may use the Eclipse IDE as shown in class to implement and run your system.
Each server should have a variable representing the temperature that is initialized randomly and a variable which is initialized to the location string. You can initialize the location string through the command line or via user input if you like.. The server can recalculate the temperature at each call.
You should write only one server program and only one client program; use either command-line arguments or user input to configure the different instances of servers and clients.