Programming CORBA with Orbacus on Linux
A simple CORBA client/server pair using IMR to start the server
This examples demonstrates ?????????
The files we have to write are:
The example can be build using this Makefile.
After succesfull build of all executables, the following steps are required for running the example.
First, you have to setup all PATH and LD_LIBRARY_PATH variables as explained
here.
Now you have to start the IMR. We need the two configuration files
Copy them into the directory $ORB_HOME/etc:
adrasteia$ cd $ORB_HOME
adrasteia$ mkdir etc
adrasteia$ cp *.conf etc
adrasteia$ mkdir db
In the example, we use host 'adrasteia' for running the IMR and host 'nike' for running the server.
Start now the IMR processes:
adrasteia$ imr -ORBConfig $ORB_HOME/etc/imr.conf --administrative&
adrasteia$ imr -ORBConfig $ORB_HOME/etc/oad.conf&
Register now the server:
adrasteia$ imradmin -ORBInitRef IMR=corbaloc::adrasteia:3800/IMR \
--add-server SRV1 "/home/ingo/serverhome/server"
adrasteia$ imradmin -ORBInitRef IMR=corbaloc::adrasteia:3800/IMR \
--set-server SRV1 args "-ORBInitRef IMR=corbaloc::adrasteia:3800/IMR"
The client can be started everywhere, if it has access to the IOR file. The server is started
when the first request from the client arrives.
To show some information, you may use the following commands:
adrasteia$ imradmin -ORBInitRef IMR=corbaloc::adrasteia:3800/IMR \
--list-oads
adrasteia$ imradmin -ORBInitRef IMR=corbaloc::adrasteia:3800/IMR \
--list-servers
adrasteia$ imradmin -ORBInitRef IMR=corbaloc::adrasteia:3800/IMR \
--get-server-status SRV1
adrasteia$ imradmin -ORBInitRef IMR=corbaloc::adrasteia:3800/IMR \
--start-server SRV1
adrasteia$ imradmin -ORBInitRef IMR=corbaloc::adrasteia:3800/IMR \
--stop-server SRV1
back to CORBA page
|