C++ RPC library suggestions

Matthieu N. picture Matthieu N. · Dec 4, 2010 · Viewed 12.6k times · Source

I'm looking for suggestions regarding RPC libraries implemented in C++, for C++ developers.

Some requirements constraints:

  • Should work on both linux/unix and win32 systems
  • Be able to execute free function and class methods
  • Hopefully written in modern C++ not 90's/java-esque C++
  • Be able to function over networks and hetrogenous architectures
  • Not too slow or inefficient
  • Hopefully provide interfaces for TR1 style std::function's et al.

My example usage is to invoke the free function foo on a remote machine.

---snip---
// foo translation unit
int foo(int i, int j)
{
   return i + j;
}
---snip---


---snip---
// client side main
int main()
{
   //register foo on client and server
   //setup necassary connections and states

   int result;

   if (RPCmechanism.invoke("foo",4,9,result))
      std::cout << "foo(4,9) = " result << std::endl;
   else
      std::cout << "failed to invoke foo(4,9)!" << std::endl;

   return 0;
}
---snip---

Something that can achieve the above or similar would be great.

Note: I am NOT interested in other language bindings. Please do not proffer a solution because it has other language bindings. I'm only interested in well designed RPC frameworks written in C++ for the C++ language, that are efficient and appropriate for HPC scenarios.

Answer

sdg picture sdg · Dec 5, 2010

That's quite a set of requirements...

While not meeting all of them (as I'm not sure that any such beast exists - I commend to your attention ICE from ZeroC. Developed in part by Michi Henning of CORBA fame (and ask your friends in telecom, that really isn't a dirty word), ICE is what CORBA would have looked like if it started later and wasn't developed by a committee.

Their C++ mapping is everything that CORBA is not, it uses STL types, and is generally newer feeling.

It fails the free-function and std::function tests, but given the improbability of finding a product for that entire list, this does a good job of many of the remainder.

Good Luck