Skip to content

Tutorial

This tutorial builds one small system in each language: a server that implements an IDL interface and registers it in the naming service under the name Echo, and a client that looks Echo up and calls it. The servers and clients are interchangeable: every client works with every server, and with omniORB, omniORBpy and JacORB ones.

The same programs are in the repository under examples/, where CI runs every server with every client.

1. Install the tools

You need the IDL compiler and a naming service (see Install):

pip install rustorb-idl
cargo install rustorb-naming

2. Start the naming service

In a terminal of its own:

rustorb-names -memory -start 2809

The root naming context is now corbaloc::localhost:2809/NameService. Every program in this tutorial finds it with the standard ORB option

-ORBInitRef NameService=corbaloc::localhost:2809/NameService

which every binding takes from its command line. (-memory forgets the names when it exits; see Naming service to keep them.)

3. Write the IDL

Every language uses the same Echo.idl:

Echo.idl
module Example {
  interface Echo {
    string echo(in string message);
    oneway void shutdown();
  };
};

echo returns its argument; shutdown asks the server to stop. It is oneway, so the client does not wait for a reply.

4. Pick a language

  • Rust: crates.io, build.rs generates the code
  • Python: pip install rustorb, the omniORBpy layout
  • C++: the IDL to C++11 mapping, CMake
  • Java: the IDL to Java mapping, Java 22+
  • C#: the IDL4 to C# mapping, NuGet
  • C: the OMG C mapping, C99
  • Ruby: the OMG Ruby mapping, gem install rustorb

Then run them together.