Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 07 Feb 2008 10:14:43 +0300
From:      <granica_raydom@rambler.ru>
To:        Adrian Chadd <adrian@freebsd.org>
Cc:        freebsd-net@freebsd.org
Subject:   Re: crpc-0.7.4
Message-ID:  <173020478.1202368483.165355804.67144@mcgi48.rambler.ru>
In-Reply-To: <d763ac660802062121k2b81db52m7b3b43cdc3ceb517@mail.gmail.com>
References:  <916331822.1202324171.150714460.5300@127.0.0.1> <d763ac660802062121k2b81db52m7b3b43cdc3ceb517@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
* Adrian Chadd <adrian@freebsd.org> [Thu, 7 Feb 2008 14:21:01 +0900]:
> On 07/02/2008, granica_raydom@rambler.ru <granica_raydom@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@freebsd.org
> _______________________________________________
> freebsd-net@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-net
> To unsubscribe, send any mail to "freebsd-net-unsubscribe@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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?173020478.1202368483.165355804.67144>