C integrated RPC

andrew babanin ababanin@gmail.com
Wed Jan 21 08:08:00 GMT 2009


In attach you can find example program,
client and server side. And doc for the system as README file.
The newest version of the sources can be downloaded from
crpc at sf dot net.

To compile the package just 'make' and 'make install'. Tests can be
found inside the tests
directory.

There are several differences between CRPC and traditinal RPC systems.
So it has no discriptive language like IDL, everything needed is taken
from the C code.
The goal of the system is to be as easy as possible.

With CRPC you do not need to give static identifiers for remote
functions, you should only
use two new modificators - __remote (to declare client function) and __local
(to declare server function). ID for the function will be computed by
wrapper compiler, as
32-bit checksum of function prototype text. With CRPC you don't need to pack
data before sending trough the net, every thing is automatically. Also CRPC
can work with pointer addressed data, I added a special __attribute__ statement,
which can tell the size addressed by the pointer. CRPC can send any data types,
any structs.

Also __in and __out modificators are available for the function
parameters, which tells
the system to send data only to the server or only fill some array on
the server. The default
mode is to send data to the server, change it there and get it back on client.

CRPC wrapper compiler can work with make and can be used 'instead' of
the GCC, as it
covers it. The wrapper compiler works between the preprocessor and
main C compiler.
Shared libraries can be biuld with this compiler. Also such __remote
functions can be
used with another servers, for example apache. (In the package there
is an example with
apache).

The client side is look like an orinary application, all __remote
function is like extern.
The server side is more looks like as library, it must not have main.
C-wrapper compiler will generate all the needed code the client and server.

CRPC can be compiled on Linux and FreeBSD. It needs only libc (and
POSIX Threads now
either). The parser system is uses is written only in C. I tried to do
it as fast as it was possible.

So CRPC is something like a C extension, which I think will be more effective if
it will be a part of the C compiler.

One more difference is that CRPC can easily 'refactor' an existing
non-network application.
You only need to add __remote modificators to function prototypes and
recompile the source
and will get network application.

Also I am working the the threaded functions, mutual variables (POSIX
Threads support).
Have plans to add crypto support based on something like ssh.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clnt.c
Type: text/x-c
Size: 1787 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20090121/fc5d6800/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: serv.c
Type: text/x-c
Size: 2546 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20090121/fc5d6800/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: README
Type: application/octet-stream
Size: 19510 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20090121/fc5d6800/attachment.obj>


More information about the Gcc mailing list