Unix Programming - RPC question

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > February 2004 > RPC question





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author RPC question
Razzle

2004-02-17, 7:33 pm

Hi!

I'm working on a RPC application, but since I tried to make my code
work with MT-safe code from rpcgen I have a few problems passing
strings.

If I have a .x file like this one:

program RCPROG {
version REMOTECOMPILEVERS {
int CREATEFILE(string) = 1;
string TEST(int) = 2;
} = 1;
} = 0x20000001;

and TEST is defined in the server program like this:

bool_t test_1_svc(int*somearg, char **result, struct svc_req *rgstp)

I should be able to pass a string to result_2 in the function above
(from the invocation of
test_1 in the client program:

CLIENT *clnt;
char *result_2;
int xx;
[...]
result_2 = malloc(256);
retval_2 = test_1(&xx,&result_2, clnt);

)like this:

strcpy(*result, "bla");

Right?
Either I'm just too blind to see an obvious mistake I made or I should
go back to basics..
All I want is that the client receives a string as result from
invoking test_1.

(Google didn't help much on this issue because nothing I found dealt
with returning strings using MT-safe code from rpcgen.
I've already posted this on comp.lang.c but I was told that this
question belongs here.)
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com