Help request -- RPC/XDR

TAYBENGH at NUSDISCS.BITNET TAYBENGH at NUSDISCS.BITNET
Tue Jan 1 11:09:00 AEST 1991


...STUFF DELETED
|error on the receive side.  I used RPCGEN to generate the XDR code from
|the following:
|
|       struct integer_array {
|          int int_data<>;
|       };
|
|This generates what looks like a pretty usable XDR module
|xdr_integer_array.  I then stuff calls into the reader and writer
|routines:
|
|       xdr_integer_array(&xdrs, i_array)
|
|where i_array is the array of integers I want to pass.  Well this doesn't
|work straight away, so I've tried all the different variations on the
|declarations and can't seem to pin down the problem.

I think you should have passed the structure - integer_array to the above
routine instead of the array of integers, since you specify integer_array
as a struct. If you want to pass the array of integers instead of struct,
you should specify the definition of the array of integers (variable
length) in XDR (see pg 59, of Sun Network Progrmming Guide) as follows:

        int int_data<>;

| ...STUFF DELETED
|o is it really possible to send arrays of data like this (I assumed so
|  since it was possible to send structures) or is it customary to send one
|  value at a time?

Yes, it is possible to send arrays of integers using notation [] (fixed
length) or <> (variable length), as documented in RPCGEN Programming Guide
(chapter 3).

Hope this helps.

Beng Hang (email: taybengh at nusdiscs)



More information about the Comp.sys.sun mailing list