>>> 2009/1/21 Joel Sherrill <joel.sherr...@oarcorp.com>: > > Is the marshalling and encoding based upon anything > standard? > > Does it support RPC's across heterogeneous hosts?
Data that should be send through the net is packed using my own method. It is rather simple, but marshaling is made automatically, in C code, generated by wrapper compiler. This data format supports so called __in and __out data, so as the system (__in and __out midificators used with function paramters). So the system can control which data should be send to the server and which data should be retrived from the server. CRPC can forward calls for remote functions, also remote calls can be done from another servers, like apache (from apache module). As it uses TCP/IP it will work with heterogeneous hosts. > > I think so. The run-time assumes POSIX threads and BSD sockets > and (I assume) POSIX mutex for the locking. But there might be some problems running treaded application yet) I am working on it. > Depending on how things go with the merge, it probably makes > sense to switch to the gcc portability wrappers for threading > and mutexes. But it is up to others on merging. I was just > trying to clarify the run-time requirements. :) > To see how wrapper-compiles extends there is two files in attach, the source and temporary compiler file after language extension.
/* * Copyright (c) 2006-2008 by Andrey V. Babanin <ababa...@gmail.com>. * All rights reserved. * * Please see COPYRIGHT. * * $Id: clnt.c,v 1.4 2008/02/06 17:13:22 granica_raydom Exp $ */ #include<stdio.h> #include<stdlib.h> #include<string.h> void __remote init_task(void); __remote void checkto (double data[3]); __remote short signed int perform_task(long int __in *mode,long int __out *data,int s) __attribute((__format_ptr(0[2],1[2]))); __remote double check(unsigned int *); __remote unsigned long int mul(unsigned long int lim); int __remote _av(char **a,int n) __attribute__((__format_ptr(0[1]))); int main(int argc,char **argv) { long int mode[2]={1,3}, data[2]={0,0}; signed short int s; unsigned int p=231, i; double q=0; double d[3]={2,4,1}; i=_av(argv,argc); printf("%d\n",i); printf("%.2f %.2f %.2f\n",d[0],d[1],d[2]); checkto(d); printf("%.2f %.2f %.2f\n",d[0],d[1],d[2]); init_task(); for(i=0;i<2;i++) { data[0]=0;data[1]=0; printf("%lu %lu %lu %lu\n",mode[0],mode[1],data[0],data[1]); s=perform_task(mode,data,2); printf("%lu %lu %lu %lu %d\n",mode[0],mode[1],data[0],data[1],s); } i=_av(argv,argc); printf("%d\n",i); q=check(&p); printf("%.2lf\n",q); unsigned long rm; rm=mul(10000); printf("%lu\n",rm); i=_av(argv,argc); printf("%d\n",i); return 0; }
r6vShf.i
Description: Binary data