Boost logo

Boost Users :

Subject: Re: [Boost-users] New library for RPC-calls using only boost and C++0x
From: Roman Perepelitsa (roman.perepelitsa_at_[hidden])
Date: 2009-06-12 04:29:47


2009/6/11 Siegfried Kettlitz <siegfried.kettlitz_at_[hidden]>

> Hello boost users and developers,
>
> i'm currently writing a library for making remote procedure calls to
> C++ objects. The library is based on the variadic templates extension
> coming with C++0x (already present in GCC 4.3) in conjunction with the
> boost library (threads, serialization, asio). The aim is to have a
> library, that is easy to integrate and doesn't require additional
> tools. Writing it, so far, has thaught me a lot about C++, templates,
> variadic templates, threading, networking etc..
>

You might want to take a look at RCF library (
http://www.codeproject.com/KB/threads/RMI_For_Cpp.aspx).

As an example, a simple echo server looks like this:

#include <RCF/RCF.hpp>

RCF_BEGIN(I_Echo, "I_Echo")
  RCF_METHOD_R1(std::string, echo, const std::string &);
RCF_END(I_Echo);

class Echo
{
public:
  std::string echo(const std::string &msg) { return msg; }
};

int main()
{
  int port = 50001;
  RCF::RcfServer server(port);
  server.bind<I_Echo, Echo>();
  server.start();
  return 0;
}

And the client:

#include <RCF/RCF.hpp>

RCF_BEGIN(I_Echo, "I_Echo")
  RCF_METHOD_R1(std::string, echo, const std::string &);
RCF_END(I_Echo);

int main()
{
  std::cout << RcfClient<I_Echo>("localhost",
                               50001).echo("my message");
  return 0;
}

Roman Perepelitsa.



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net