Starting from:

$19.99

Computer Systems Project 3

turnin id: cs_p3

Write a 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 server function provided for you in
p3server.c in the public directory. Note that that program depends on
values being set in the environment. My 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 server and should exchange appropriate messages
accordingly. Details will be discussed in class.

Each time the child process receives a message from the server, 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 p3.tar ./p3dir ## do *NOT* use full pathname of the dir
After un-tarring the project, I will cd to the dir containing it and type:
rm -f p3
rm -f *.o
make
It should build an executable named p3.

More products