Corba and omniorb


What is the CORBA?

If you want to call a function from remote node (ex. run on other computer via network) or call a function which is implemented in different programming language, same as when you want to talk with person who say different language, you will need a middle man to help you can communicate. And the CORBA’s function here is the same as the middle man.


As you can see from the above figure, you can think CORBA’s functions is same as a DNS server. You can register an Object to it then programs from remote node can come to it and ask for address of the Object, call a function on that Object which is exported via an interface that known by both side (IDL interface). Also same as there are many of middle man out three, there are several implementations of CORBA and omniORB is one of that implementations. In this post, I’ll show you how to install omniORB and run some example from the source code to see how it work from the action.

Download and install

You can download the omniORB from here:

Steps to install it are quite easy, cd to folder the source is downloaded into and run below commands

$ tar -xjvf omniORB-4.2.0.tar.bz2
$ cd omniORB-4.2.0/
$ ./configure
$ make -j4
$ sudo make install

Build examples from the source code

$ cd src/examples/
$ make

To understand some terms and examples you should read this document

Run omniname which is omniORB’s middle man, this is my script you should read it and the document then modify some to have it runs on your system



rm -f $RUN_DIR/*.bak
rm -f $RUN_DIR/*.dat
rm -f $RUN_DIR/*.dat.log

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

cd /usr/local/bin
#./omniNames -ORBendPointPublish giop:tcp: -ORBtraceLevel 25 -start 9100 &
./omniNames -start 9100 &

Run examples:

First, we have to setup an omni-config-file which specify the omniname’s address:

# omni_app.cfg

#endPoint = giop:tcp:

Then export it to our program (of course, you have to know the middle man’s address, right?)

$ export OMNIORB_CONFIG=/opt/mssng/oam/etc/omni_app.cfg

Show log when run app

$ export ORBtraceLevel=25

Here I just copy echo.idl and eg3 from example and modify it for testing

$ mkdir testomniORB; cd testomniORB
$ cp omniORB-4.2.0/idl/echo.idl
$ omniidl -bcxx echo.idl
$ g++ -lomniORB4 -lomnithread -o ex3_impl_mulinst
$ g++ -lomniORB4 -lomnithread -o ex3_clt_mulinst