Assignment 4
Due date
This assignment is due on Sunday 29 Oct at midnight.
General
This assigment completes the work of turning this into a client using
the network to talk to the jukebox server. It replaces the local function
calls for audio files with Remote Procedure Calls across the network.
The concepts that are used in this assignment are
Specification
You have to write two functions
char **list_sounds(void)
char *fetch_sound(char *)
These should use the RPC functions defined in ~ostutes/ass4.x:
program ASS4_PROG {
version ASS4_VERS {
string LIST_SOUNDS(void) = 1;
string FETCH_SOUND(string) = 2;
} = 1;
} = 291095;
Note that LIST_SOUNDS() returns a string only, with each file+description
on a separate line. You will have to do some work to turn it into an array
of strings as required by list_sounds().
If there are no sounds, or if the fetched file does not exist, the functions
return an empty string "" rather than NULL. This is because the RPC does
not cope well with NULL.
Submission
Submit a file containing only your implementation of the procedures
list_sounds() and fetch_file(). It will need to contain an external
definition of handle
extern CLIENT *handle;
I do not want any other functions in the file.
For your own testing, you could add RPC initialisation code to your
assignment 3. The machine that holds the sound files is
pandonia.canberra.edu.au.
Submit your file file using
give a4 your-file