Write a UICI client which will take input from standard input, and send it to the remote UICI server. When an end-of-file is encountered, the client terminates.
Call your server program server1.c. It should take one command line argument which is the port number. Call your client program clientin.c. It should take two command line arguments, the name of the remote server and the port number.
Have your server program display the number of bytes received so far when it receives a SIGUSR1 signal, and the number of bytes sent so far when it receives a SIGUSR2 signal. Use a value of 1024*8*16 for MAXSIZE during testing. This allows for 16 seconds of audio. Test your client program by redirecting standard input from /dev/audio.
You can start with the programs B.2, B.3, and B.4 from Appendix B. B.1 contains the uici.h header file. Little, if any, modification will need to be made to the client program and only a small modification to the server is required. The uici implementation should not be modified. These files are available in /usr/local/courses/cs3733/pup/apB.tar. This also contains a makefile. Start by compiling these programs and making sure the client can send to the server.
Students will be assigned ranges of port numbers to use so that there is no conflict.
Turn in copies of any modified source code and describe what happened when you tested your programs.
Copy your clientin.c file to clientout.c. Modify it so that instead of sending data it receives data from the communication channel and sends to to the /dev/audio device. After it receives all of the data it should close the audio device and exit.
Turn in copies of any modified source code and describe what happened when you tested your programs.
Turn in copies of any modified source code and describe what happened when you tested your programs.
One problem with the implementation of PART III is that each child gets its
own copy of the audio buffer. Since this can be quite large (a half-megabyte
per minute) it would be better if this could be shared. One method would be
to store the audio in a file and have each of the children open that file.
Instead, modify your server3.c program (call it server4.c) so that the
audio buffer is kept in shared memory. Shared memory segments are controlled
much like semaphores. See Section 8.9.1 of PUP and the man pages. Since the
shared memory segment will be used only by children of the parent, you can
use IPC_PRIVATE for the first argument to shmget. The shared memory segment
should be removed by your program when it is no longer needed.
You can use