[Sunhelp] RPC Call fails.

munkumar at hss.hns.com munkumar at hss.hns.com
Tue Oct 10 08:34:00 CDT 2000



hello again,

Since I found the problem I feel it will be good for others to share my
solution.
But at the same time I have one more question.

What is the possible reason for failure of xdr_vector() function call. It works
for one
u_char array of size 3,5or 8 but fails for array of bigger size(100). The
obvious pointer
here is some memory issue. But can anybody tell me what parameter do I need to
set to take care of this issue ?

regards
muni

Here is the solution.

The implementation of unions in the RPC is in a form of a structure which has
two elements, one integer
and other union as represented. It is important for the integer to have a value
which maps to a union
variable as will be defined in the RPC .x file (see sample .x file below. ) If
this integer variable has a value
which is not one of the defined in the case values of the union, the problem
given below occurs.
/* In the .x file */
union myunion switch(int disc)
{
     case 0: int a;
     case 1: int b;
}
typedef struct myunion myunion;
/* End */

/* Generated */
struct myunion
{
     int disc; /* This variable should have val 0 or 1 only */
     union {
     int a;
     int b;
     } myunion_u;
};
typedef struct myunion myunion;
/* End */






munkumar at hss.hns.com on 10/10/2000 05:06:05 PM

Please respond to sunhelp at sunhelp.org

To:   sunhelp at sunhelp.org
cc:    (bcc: Munish Kumar/HSS)

Subject:  [Sunhelp] RPC Call fails.







hello,

I am running a client-server application where I am using RPC for communication
between the
client and server. The request being send from the client to the server contains
a few parameters
implemented in unions. While sending these I get an error "RPC: Unable to encode
arguments." The same
application works fine for other calls where the request is a simple structure,
i.e it has no parameters implemented
as unions.

Can anybody please help me find out what could be the possible explanation for
this behavior? Any
suggestions/pointers are welcome.

regards
muni



_______________________________________________
SunHELP maillist  -  SunHELP at sunhelp.org
http://www.sunhelp.org/mailman/listinfo/sunhelp











More information about the SunHELP mailing list