Before asking questions regarding this exercise, please review the lecture notes of Week #01 and #02 as well as the documentation linked to on this page.
Use Sun RPC to implement a simple file server. The file server should implement simple functions that allow clients to read from and write to files hosted on the server. It is up to you whether you want to make the server stateful or stateless.
> cat date.x program DATE_PROG { version DATE_VERS { long BIN_DATE(void) = 1; string STR_DATE(long) = 2; } = 1; } = 0x31234567;
> rpcgen -Ca date.x > ls Makefile.date date.x date_clnt.c date_svc.c date.h date_client.c date_server.c
> make -f Makefile.date
> ./date_server(Note: On Mac OS X I found that I had to start the server as root with sudo)
> ./date_client localhost
A nice set of slides that gives a good overview of XDR data types and other RPC programming issues.
If you want more detailed information, Part 2 of the Sun Network Interfaces Programmer's Guide has all the information you'll ever want about RPC programming.
This page is maintained by cs9243@cse.unsw.edu.au Last modified: Monday, 07-Sep-2020 22:07:44 AEST