CORBA 2.6.1 Getting Started Guide for C++

Configuring NonStop CORBA for the Stack Example
Before you can run the stack example, you must configure the stack server for your particular system by editing, then sourcing, the stack server
configuration script
config.src:
1. Edit the
config.src file, changing the CHANGE_ME value to a valid TCP host name or IP address.
2. Use the
cfgmgt tool to source the stack-server configuration script by issuing these commands:
> cfgmgt
> source config.src
> exit
These commands load the sample_stack@ORB entity.
Running the Stack Example on OSS
The Stack example is now ready to run. If your NonStop CORBA system is not already running, you must start it by using the Distributed
Component Console or the
nsdstart script.
To run the Stack example, open two OSS windows. In each window, navigate to the directory where the stack sample was built, the
samples/stack. Before running the program, make sure that each window has the correct NonStop CORBA environment setup, which is
obtained by sourcing the
env.sh script.
Start the server program in one window by using the following command:
server -ORBprofile sample_stack
In the other window, start the client program by using the following command:
client
After starting the client program, you should see the following output in the client window:
Top: 100
Top: 200
Top: 300
Top: 400
Top: 500
Top: 600
Top: 700
Top: 800
Top: 900
Top: 1000
Got STACK_OVERFLOW exception as expected.
Pop: 1000
Pop: 900
Pop: 800
Pop: 700
Pop: 600
Pop: 500
Pop: 400
Pop: 300
Pop: 200
Pop: 100
Got STACK_UNDERFLOW exception as expected.
If you see the output as described above, you have successfully built and run the stack example on your NonStop CORBA system.
Once you are satisfied with the output, you can stop the server program (in the server OSS window) by pressing Ctrl-C.
You can now begin developing your own CORBA clients and servers on your NonStop CORBA system.
If you do not obtain the output as described above, either you have not correctly installed and configured NonStop CORBA, or you did not build
and run the example program correctly. You can start the debugging process by using PATHCOM to view the status of your NonStop CORBA
server-pool processes to see if the ORB processes are running.
Using the Stack Example With IIOP/SSL
To run the Stack example with IIOP/SSL enabled, you run the sample as described above, except you change the configuration database
settings for the client and server.
Change the server configuration by entering
catch {entitydelete sample_stack@ORB}
entity sample_stack@ORB {
tcp_server true
ssl_only true
ssl_port 0
host_name <change_me>
ssl_cert_file $nsd_root/gregsCA/GServer.pem
ssl_pkey_file $nsd_root/gregsCA/GServer.pem
ssl_pkey_pswd $nsd_root/gregsCA/yo.txt
ssl_ciphers ALL:!ADH:RC4+RSA:+SSLv2:@STRENGTH
}
Where,
change_me is a dot-separated IPv4 address like 172.31.41.151 or
colon-separated IPv6 address like fe80::a00:8eff:fe06:d093.
Change the client configuration by entering: