Example 1: basic of remote interface

This example shows the basic of creating remote interface and introduces some basic features below:

  • synchronous method
  • asynchronous method
  • const qualified method
  • putting remote interface into namespace
  • binding target object to remote interface
  • getting a remote interface pointer from session

Example 2: passing parameter

This example shows basic parameter passing supported by this library. This example introduces the items below:

  • Passing serializable object
  • Passing serializable container
  • Passing reference and pointer
  • Passing shared_ptr and weak_ptr
  • Binding shared_ptr to remote interface
  • Getting raw pointer of remote interface

Example 3: session and server

This example explores more about session and server classes, and it also shows how to set attributes of remote pointer. It introduces the items below:

  • Handling session and server events
  • Connect session and server with customized bindings.
  • Setting number of thread for global io_runner
  • Binding multiple instances of object as remote services
  • Binding target as remote service through a session object at client site
  • Change remote pointer to one-way call mode
  • Rethrowing exception pointer

Example 4: remote pointer as parameter

In this example, we explore the remote pointer and how we can pass it as remote method parameter. It introduces the items below:

  • get a remote pointer with bind method.
  • get a remote pointer with remote_cast method.
  • pass remote pointer to a remote method.
  • return remote pointer from a remote method.
  • pass many remote pointers to a remote method with a container.

Example 5: remote adaptor and factory pattern

This example shows how to adapt existing class to bind with remote interface and implement remote factory pattern. It introduces the items below:

  • remote::pool_node class.
  • retrive target pointer from remote pointer using target_cast method.
  • how to create an adaptor class to adapt existing class to remote interface.
  • how to create remote service on demand.

Example 6: chat room and observer pattern

We are going to create a chat room in this example. It introduces the items below:

  • publish-subscribe feature
  • extend observer pattern to the interprocess space.
  • get callback from remote process.