0

I'm toying with the idea of using RPC ( remote procedure calls ) on Linux to communicate between two processes on the SAME server. Therefore the data format of multi-byte variables will be the same and really won't need to be transformed using XDR. Is it possible to use RPC without XDR on linux? If so, do any examples of this exist?

If I want a function declared that takes 3 shorts as arguments without using XDR Would I declare the function like this?

program MESSAGEPROG {
    version MESSAGEVERS {
       int PRINTMESSAGE(short, short, short) = 1;
    } = 1;
} = 99;

Thank you.

Chimera
  • 5,884
  • 7
  • 49
  • 81

1 Answers1

1

Yes, that is possible. See the first example in the following rpcgen guide: http://docs.freebsd.org/44doc/psd/22.rpcgen/paper.pdf

Matthias
  • 8,018
  • 2
  • 27
  • 53
  • Thank you Matthias. I see where the second example is showing the use of XDR. However, it's still unclear to me how I would go about writing the RPCGEN file to say declare a function that takes 3 shorts as arguments without having RPCGEN generate the XDR routines. Please forgive me for being ignorant of these matters, I've never worked with RPC's before. – Chimera Mar 23 '12 at 21:56
  • You shouldn't care. Just use RPC with XDR. It does not matter. The bytes needs to be serialize anyway, might as well do it with XDR. – nos Mar 23 '12 at 23:57
  • As `nos` said, go ahead and use XDR. The marshaling/demarshaling time will be insignificant compared to the networking time. – Alex Measday Mar 24 '12 at 04:15