************************************************************************* A Sample Multithreaded RPC System supporting Mathematical Functions ************************************** Objective : Using client-server architecture, write a multi-threaded server which returns results of mathematical functions such as sqrt(x),sin(x), cos(x), tan(x), etc. and a companion client to invoke these functionalities from a remote machine. Program Logic: ************** 1)Client Interface/API: The client should implement a function with the prototype: float gridbus_rpc( string , float ) The first parameter would be the name of the mathematical function to be invoked on the server and the second parameter would be the value passed as argument to the invoked function. An example would be : val=gridbus_rpc("sqrt", 9) A call to this function would result in the client converting the parameters to string, opening a socket connection with the server, transmitting the parameters and then waiting for the result from the server. The result which is received as string should be converted to float and displayed. The design of internal protocols for communication between the client and server is left for the students to design. 2)Server: The server should listen for connections on a port number supplied as command line argument. For example, we can start the server as follows: % java MathServer 4500 (where 4500 is a port number) When a connection is received from the client, the server should start a new thread to deal with the client, receive the parameters, perform the computations and return the results. The basic functionalities to be implemented are sqrt(x), sin(x), cos(x), tan(x), log(x) and prime(x) (which finds out if a number is prime or not). Implementation of additional functions are welcome including those with more than one parameter. 3) Client Applications: Write a sample client application that invokes "gridbus_rpc" functions and demonstrates services provided by the server. If you client application name is "MyClient", then accept port_number through command line argument, so that it can be involved as follows: "MyClient Server_Host_Name 4500" e.g: "MyClient manjirra.cs.mu.oz.au 4500" Language: ********* The exercise can be implemented in either Java(preferably) or C but the programs should not use RMI(Java) or RPC(C). Please stick to basic networking and multithreading libraries in either case. Testing and Evaluation: *********************** You need write your own client application that demonstrates all functionalities. However, the lecturer may write a simple client program using the "gridbus_rpc" call/syntax. This assignment carries FIVE marks. Submission Deadline ******************* Aug 27, 2002 You will basically need to demonstrate its working and submit a short report. You need to write a short report (highlighting the system architecture and client-server protocol along with appropriate diagrams). Also include a printed copy of your program (both client and server). *************************************************************************