How do I tune the behavior of the LIOP and IIOP ORB programmatically?

From Support
Jump to: navigation, search

Question:

How do I tune the behavior of the LIOP and IIOP ORB programmatically?

There is no mechanism in VisiBroker to configure more than one ORB/adapter from the command line.

From the command line one can configure the IIOP ORB/adapter, or the local IPC ORB/adapter, but not both.  To  configure both ORBs must be accomplished programmatically.

Answer:

For this reason, we specified "-OAlocalIPC 0" on the command line for the test in order to turn off the localIPC
adapter and demonstrate the effectiveness of the ORBconnectionMaxIdle parameter on the IIOP adapter.

Multi-threaded VisiBroker for C++ clients will use inter-process communication (IPC) when communicating with
multi-threaded VisiBroker for C++ servers located on the same host.  This communication is performed using the
LIOP ORB.  Ordinarily, command-line -ORB options are used to tune the behavior of a client.  However, by default  all -ORB options are consumed by the IIOP ORB, and will not be used to tune the LIOP ORB.

There are two ways to tune the behavior of the LIOP ORB using -ORB options:

1) Explicitly initialize the ORB by modifying the main program. The default (IIOP) ORB is still initialized using the
command-line arguments as usual.  The main program then explicitly initializes the LIOP ORB with its
pre-determined settings:

        // C++ Main Client Program
        CORBA::ORB_var default_orb = CORBA::ORB_init(argc, argv);

        int local_argc = 2;
        const char* local_argv[] = { "-ORBconnectionMaxIdle", "0" };
        CORBA::ORB_var local_orb =
                CORBA::ORB_init(local_argc, local_argv, "LIOPORB");

2) Force all command-line arguments to tune the LIOP ORB and have none go to the IIOP ORB.  In this case the C++
main program is as usual:

        // C++ Main Client Program
        CORBA::ORB_var default_orb = CORBA::ORB_init(argc, argv);

But all arguments are pushed to the LIOP ORB with the command-line switch "-ORBid":

        prompt> my_client -ORBid LIOPORB -ORBconnectionMaxIdle 0

But the client's IIOP ORB will be initialized with the default settings. There is no way to confiure both the IIOP ORB
and the LIOP ORB from the command line at the same time. This is an undocumented limitation at  this time.

If the clients and the server are running on the same host, then the server should be configured using:

        "-ORBid LIOPORB -ORBconnectionMaxIdle 0"

If the clients are running on other hosts than the server, then the server should be configured using:

        "-ORBconnectionMaxIdle 0"

If clients are running on the same host as the server, and clients are running on remote hosts, then the server code
must be modified as described in option 1) above.



Article originally contributed by Borland Developer Support