When a connection request comes in, the forked child will read a record of size SERVER_IO_SIZE. This record will contain two character strings separated by a blank. Note that here the string terminator is a blank, unlike in C. The first string will be interpreted as a directory and the second will be the name of a program. The child will switch to the directory and compile the named program. It will then send back a single byte to the network, 0 for success, and 1 for failure.
For example, if the string received was
the program would move to the directory /home/student/cs3733/assign4 and execute
cc -c first.c.
Modify your makefile appropriately. Use a value if 128 for SERVER_IO_SIZE and test your server using the client from Part 1. You may have to slightly modify the client so that you can see the value returned by the server.
The program will take three command line arguments: a port number and
two file names. The first file will contain a list of machine names,
one per line. The second file will contain the name of an executable
on the first line followed by names of programs to compile, one per line.
For example, the first file might contain:
and the second file might contain:
linker will read in these files and for each program to compile, it will send a request for compilation to one of the machines listed in the first file. Start with the first machine and use the machines in the order given. If the number of machines is smaller than the number of compiles to do, treat the list of machines as a circular list so that some machines may be used more than once. You should do this in such a way the the compilations are done in parallel. When all of the compilers have reported their results, print out an error message if at least one was unsuccessful. Otherwise, link the object files into an executable and print a message indicating success.
You may assume that all of the files to be compiled are in the same directory. Test this in the case that the number of machines is smaller, equal to, and greater than the number of compiles to do.
Modify Part 3 so that all error messages come back to the linker and the user can tell from the linker output what errors occurred in what module. Make sure your solution is robust.