crpc-0.7.4

granica_raydom at rambler.ru granica_raydom at rambler.ru
Wed Feb 6 23:14:46 PST 2008


* Adrian Chadd <adrian at freebsd.org> [Thu, 7 Feb 2008 14:21:01 +0900]:
> On 07/02/2008, granica_raydom at rambler.ru <granica_raydom at rambler.ru>
> wrote:
> >  Hi all,
> >
> > The CRPC (C-based remote procedure call) version 0.7.4 is now
> available.
> > To download the package use the link on the project site -
> > http://crpc.sourceforge.net/
> >
> >  Write me back, if you have any questions.
>
> How's this different from Sun's RPC stuff?
>
>
>
> Adrian
>
> --
> Adrian Chadd - adrian at freebsd.org
> _______________________________________________
> freebsd-net at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-net
> To unsubscribe, send any mail to "freebsd-net-unsubscribe at freebsd.org"

 I worked generally on the programer's interface. For example, in SunRPC 
we have such definition and
client code:

////////////////////////////////////////////////////////
const MAXSORTSIZE  = 64;
const MAXSTRINGLEN = 64;

typedef	string  str<MAXSTRINGLEN>;  /* the string itself */

struct sortstrings {
    str ss<MAXSORTSIZE>;
};

program SORTPROG {
    version SORTVERS {
        sortstrings SORT(sortstrings) = 1;
    } = 1;
} = 22855;
////////////////////////////////////////////////////////////////////////
#include <stdio.h>
#include <rpc/rpc.h>
#include "sort.h"

int
main(int argc, char **argv) {

	char *machinename;
	struct sortstrings args, res;
	int i;

	machinename = argv[1];
	args.ss.ss_len = argc - 2;     /* substract off progname, 
machinename */
	args.ss.ss_val = &argv[2];
	res.ss.ss_val = (char **)NULL;

	if ((i = callrpc(machinename, SORTPROG, SORTVERS, SORT,
	    xdr_sortstrings, &args, xdr_sortstrings, &res)))
	{
	    fprintf(stderr, "%s: call to sort service failed. ", 
argv[0]);
	    clnt_perrno(i);
	    fprintf(stderr, "\n");
	    exit(1);
	}

	exit(0);
}

 But using CRPC we can have rather simular client code like this:

#include<stdlib.h>

__remote int
sort(char **ssp, int size) __attribute__((__format_ptr(0[1])));

int
main(int argc, char **argv) {

    int res;

    res = sort(argv+1,argc-1);

	exit(0);
}

 In CRPC, all the stub information is extracted from the prototype 
declaration, function call is the same, as
 in ordinary program. Also the system could work with any data type, 
defined in the C code.
 And this file is to compiled with the rcc only, cause it is a gcc 
wrapper.


More information about the freebsd-net mailing list