TERM PROJECT

The purpose of this project is to learn how to exchange information between processes using sockets as well as using select/synchronization.

WHAT TO SUBMIT:

You will need four .c files at a minimum - client.c, server.c, parse.c and student.c. Two executables named client and server will be created. Use the test case file of the first assignment to test your program as in the first assignment.


PROBLEM DESCRIPTION

The program you write must have two parts to it - server and client. They are independent processes. Based on your group, you are given below whether to create a UDP client/server or a concurrent TCP server or iterative TCP server.

Command Line Arguments:

Network Byte Order: Please ensure that whereever you are using an integer - whether 16-bit or 32-bit - you use the htons, htonl, ntohs, ntohl macros. If you do not do this, the programs will result in error if the end systems are of different architectures. You will LOSE MARKS if you do not do this.


CLIENT

From the first assignment, use the parse module to parse the data from the file. Instead of calling APIs exported by the student module, it calls an API in the client module. The client module must pass the operation and the information related to the operation to the server side using the socket. Then, it has to wait for a reply from the server on the read pipe to check whether the operation was successful or not. Finally, it has to send the operation "List" to the server side. The server sends all the database information to the client on the socket. The client reads the data from the socket and writes it to the output file. Once it has received EOF from the server socket, it exits.

NOTE: The format of the output file is the same as that in the expected output file of the first assignment.

MULTIPLE CLIENTS: Testing of the project will be done with multiple clients running on a single system - can be same as the server system or a remote system - and different clients on different systems. Each client will have a different input file which will be used to update the student database. At the end, the database has to be in a consistent state, i.e., irrespective of the number of times we test with these clients, the final output from the database MUST be the same.

(NEW) NOTE: The initial database of different clients will be unique - i.e., no client will encounter duplicate student record error when trying to add students into the database. Later, however, there can be duplicate records and other errors due to different sections of different clients.


SERVER

The server is the module which interfaces with the student module of the first assignment. It reads data from the socket on which the client sends the operations and information related to the operation. It calls the APIs exported by the student module. It sends the return value from the student module API as a reply to the client on the socket. When it gets the list operation, it calls the getrecord API from the student module and writes the data to the socket to send the records to the client. It calls getrecord until there are no more records to get. At this point, the server has finished its job and will terminate.

REQUIREMENTS ON THE SERVER SIDE:


GROUP - Type of Server Assignment

C05_C58: TCP Concurrent Server using threads

C09 : UDP Server with a client using select()

C10_C15: TCP Iterative server using select()

C11_C51_T06: TCP Iterative server using select()

C12_T37_T38: TCP Concurrent Server using threads

C13_C23_T17: TCP Iterative server using select()

C16_C35_T12: UDP server with a client using select()

C18_C61_T35: UDP server with a client using select()

C19_T42: TCP Concurrent server using threads

C20_C45_T25: UDP Server with a client using select()

C21_C40_T19: TCP Concurrent Server using threads

C22_C64_T03: TCP Concurrent Server using threads

C29_T20_T05: TCP Iterative Server using select()

C56_C57_I30: TCP Concurrent Server using threads

C60_C62_I09: TCP Iterative Server using select()

T15_T39: UDP Server with a client using select()

T22_T29_C42: TCP Iterative Server using select()

T40_I04_C50: TCP Iterative server using select()