SOLVED:Computer Systems Project 5 socketpair system call

$60.00

Original Work ?
Category: You will Instantly receive a download link for .ZIP solution file upon Payment

Description

5/5 - (3 votes)

Write a C/C++ program that uses the socketpair system call to create
a pair of sockets, and uses the fork system call to create a child
heavy-weight process.

The child process should invoke the p5server function provided for you in
p5server.c in the public directory. Note that that program depends on
values being set in the environment. Our tests will set those variables
prior to executing your program.

The parent process should act as a client and conform to the message-passing
interface defined by the p5server and should exchange appropriate messages
accordingly. Details will be discussed in class.

Each time the client process receives a message from the p5server, print:

CLIENT recvd len %d msg :%s:

where %d and %s are replaced by the values actually received.

——–

TURNIN info:
You should submit a tar file of a directory which contains all of the
required files (makefile, C source files, header files, etc).
Sample tar command to create a tar file from a dir:
tar cvf p5.tar ./p5dir ## do *NOT* use full pathname of the dir
After un-tarring the project, we will cd to the dir containing it and type:
rm -rf p5
rm -f *.o
make
It should build an executable named p5.

********
The submitted file must:
– be a tar file
– un-tar into the *correct* set of files (above)
– build an executable named p5
else it will NOT be graded further.
********