RPC programming
Mike Hoegeman
mh at awds26.eaton.com
Fri Mar 2 08:44:21 AEST 1990
In article <8008 at cs.utexas.edu> tph at cs.utexas.edu (Pow-Hwee Tan) writes:
>Howdy!
>I have just started doing some NFS programming using RPC and XDR, and
>have the following questions which I hope some of you can enlighten
>me.
>1. I am using the intermediate RPC layer of function calls as described
>in Sun's documenation. The two functions calls I used are callprc and
>registerrpc. Both of these functions require a program number as
>parameter. As I understand from the documentation, I can use the numbers
>in the range 0x20000000 - 0x3fffffff. Am I right? Or do I need to
>make some kind of call to find out what number I should use?
there is no call to get an OK program number , just use one in the
temporary range.
also, just from the general tone of your message, i would guess that you
need to read up on RPCGEN, which is an RPC client <-->server protocol
compiler. this will do a lot of the mechanical rpc coding for you.
it will elminate you needing to things like 'registerrpc'.
>2. The XDR serializing/deserializing routines do not explicitly free
>the memory allocated. How can I free them myself?
for free client side xdr memory, check out clnt_freeres in the RPC(3N)
man page for sunOS. you should'nt need anything on the server side if
you use RPCGEN. also check out clnt_create, clnt_call, and
clnt_destory. you should really use these instead of callrpc. in fact,
if you use RPCGEN you just call a canned routine that RPCGEN makes for
you from your protocol description.
More information about the Comp.unix.questions
mailing list