Horus Doc || Corba Reference || Corba   Client Server   Stubs C++   Stubs Java   Servant Generator  

C++ client

An example is given in HxSamples/ConsDemo/clientDemoImageOps.c.

CorbaClientCpp.gif

C++ client application structure

Basically, a client takes the following steps:

In a normal client-server configuration, any call to a member function of a stub results (in the end) in a call to a servant member function. The <<Corba call>> in the figure is then done via IIOP. However, if the client use the "-createServer" option (see below), the server runs in the same process as the client and the <<Corba call>> is a normal virtual function call.

To indicate the Horus server we want to be a client of there are some command line arguments (handled by HxDefaultCorbaMediator in C++):

-useServer name
connect to the server registered in the NameService under "HxCorba/Servers"
-useServerRef ior
connect to the server designated by the given ior, e.g. a corbaloc
-createServer
start a new server within the client process

For example, to have the client call the Horus server that is running on the machine Mach2 at port 8010 use:

clientDemoImageOps -useServerRef corbaloc::Mach2:8010/Constructor

To use the Horus server that is registered in the Naming Service under the name TheServer:

clientDemoImageOps -useServer TheServer

The Corba version of the shot detection program (clientShotDetection) is an example of a client that communicates with two Corba servers : a Horus server to do the processing and an OracleServer to store the results in the Oracle database. To use the Horus server running on the localhost at port 8888 as well as the OracleServer running on carol at port 9999 use:

clientShotDetection -useServerRef corbaloc::localhost:8888/Constructor \
                    -ORBservice Database corbaloc::carol:9999/Oracle


Go to the next section or return to the index.


Generated on Mon Jan 27 15:20:57 2003 for CorbaReference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001