You are on page 1of 1

Project

The project must be implemented individually. Implement a middleware system able to communicate a
client and a server according to the following instructions.

Write a server program that is in an infinite loop attending requests. The server must
implement the following operations:
public void addition(float a[][], float b[][], float r[][]);
public float greatest(float v[]);

Write a client program that implements the following operations:


public void print(float v[]);
public void print(float m[][]);

The client must show the following menu:


1. Addition
2. Greatest
3. Exit

The client program only exits when the Exit option is selected. When the Addition operation is
selected, the program asks the user for the size of the matrices. The program then asks for the values of
the matrices. In the case of the Greatest operation, the program asks for the size of the vector and then
for its values.

After the operation Addition or Greatest is executed, the result of the operation is printed on the screen
of the client.

The client requests the server program to perform the operations (Addition, Greatest). When the client
makes a request to the server, the client sends:
1. the type of operation to perform
2. the data

As a consequence, the server sends the data that results from the requested operation.
The data is flattened into data streams by the client so that it can be sent over a TCP socket. The server
also flattens the data obtained as result. The client receives the result over the socket and prints the
result on the screen.

The client must be implemented in Java using DataInputStream and DataOutputStream to read and
write to the socket in a platform independent way. See examples.
Supported operations can be consulted in:
http://docs.oracle.com/javase/6/docs/api/

The server must be implemented in C.

The data (i.e. the arguments) must be sent as a flow of bytes representing float numbers. The data must
not be encapsulated as strings.

You might also like