in Education by
Creating a simple server-client program using rpcgen. I'm writing this .x file: program REMOTE_PROG { version MSG_RCV { int STRLEN(string) = 1; double SQUARE(double *) = 2; int NUM_OF_DEV(int *) = 3; } = 1; } = 99; executing with rpcgen file.x -> generates file_svc.c. in the file_svc.c file, for some reason, it generates each function case with _svc extension: case STRLEN: xdr_argument = xdr_wrapstring; xdr_result = xdr_int; local = (char *(*)()) strlen_1_svc; //<--_SVC break; and when I try to compile the server after implementing the functions int * strlen_1(char **, CLIENT *); the compiler raises that error: "_strlen_1_svc", referenced from: _remote_prog_1 in file_svc-8501b7.o ld: symbol(s) not found for architecture x86_64 But if I'll delete that auto generated _svc extension,local = (char *(*)()) strlen_1; //no _svc the program will compile successfully. Why does this happen? why does the rpcgen adds the _svc extension to the functions and am I doing something wrong when I delete the _svc? P.S same error also for square and num_of_dev functions, gave only strlen for example. Thanks! JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
That's the convention, the _svc is short for service. Your server needs to implement the service function, that is the strlen_1_svc function. Your client calls the strlen_1 function. rpcgen + the RPC library does all the inbetween - it generates code for strlen_1 used by the client which will serialize the data and transfer it to the server, where an event loop dispatches the call to your code in the strlen_1_svc function.

Related questions

0 votes
    This question already has an answer here: C/Unix Strange behaviour while using system calls and printf (1 ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    This question already has an answer here: C/Unix Strange behaviour while using system calls and printf (1 ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    This question already has an answer here: C/Unix Strange behaviour while using system calls and printf (1 ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    I am a newbie trying to code a serial driver(PCI based ) and I don't want to use the ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 17, 2022 in Education by JackTerrance
0 votes
    In my signal.h file I have added a signal handler like this: #define SIG_WPG ((__sighandler_t)3) and ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 13, 2022 in Education by JackTerrance
0 votes
    Which of the following adds marginal sums to an existing table? (a) par() (b) prop.table() (c) ... Linear Regression of R Programming Select the correct answer from above options...
asked Feb 12, 2022 in Education by JackTerrance
0 votes
    what a list indents each item in the list and adds a bullet against each item what's attribute of tag puts the ... answer It is urgent Select the correct answer from above options...
asked Dec 11, 2021 in Education by JackTerrance
0 votes
    The ___________ class adds a rounded border around an element with a gray background color and some padding. ... .alert .jumbotron Select the correct answer from above options...
asked Dec 10, 2021 in Education by JackTerrance
0 votes
    Which of the following adds all new files to local repository? (a) git add . (b) git add -u ... questions and answers pdf, Data Science interview questions for beginners...
asked Oct 29, 2021 in Education by JackTerrance
0 votes
    Which looping statement allows XML tags to appear in JavaScript programs and adds API for operating on XML ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 23, 2021 in Education by JackTerrance
0 votes
    The algorithm that takes a set of dependencies and adds one schema at a time, instead of decomposing the ... , Database Interview Questions and Answers for Freshers and Experience...
asked Oct 11, 2021 in Education by JackTerrance
0 votes
    Apigee adds ____ before your API along with policies. Manager Gateway All the options Proxy...
asked Sep 3, 2021 by JackTerrance
0 votes
    In MongoDB, identify the command that adds an shard with a sharded Cluster. (1)add (2)Shardadd (3)addShard (4)ShardAdd...
asked May 23, 2021 in Technology by JackTerrance
0 votes
    ____________ adds robust security practices and strategies to traditional DevOps practices. DevSecOps Rugged DevOps...
asked Oct 27, 2020 in Technology by JackTerrance
...