EXAMPLES

Tutorial

1) Description

The Tutorial consists of three executables that together make up a primitive chat box

2) Design

The 3 executables are:

3) Scenario

The Chatter and MessageBoard executables support optional command-line parameters. When these parameters are not specified, default values are used instead. The optional parameters and their meaning are:

Running of examples

Running the examples in a Posix environment

Environment Setup

Let's call OpenSplice_install_dir the OpenSplice installation directory.

The OpenSplice environment variables must be set in order for the examples to build/run correctly. To do this, open a terminal and source the "OpenSplice_install_dir/release.com" script supplied with the distribution.

C and ISO C++ Executables

Building the examples is described on the Summary page

Three executables are generated in the examples build/bin directory when the example is built:

For C

For ISO C++ 2

Java5 executables

Building the examples is described on the Summary page

Three jars are generated in the java5 directory when the example is built:

For Java5

Running the example

Ensure that the environment for OpenSplice is set up correctly as described above for each new terminal used.

It is recommended that you run the subscriber and publisher in separate terminals to avoid mixing the output

Running in single process (heap memory) configuration : the application starts OpenSplice middleware

Running in multiple process shared memory configuration

To enable deployment in this mode, an OpenSplice configuration file must be selected that has shared memory support e.g. one of the ospl_shmem xml configuration files found in the OpenSplice_install_dir/etc/config directory.

Running the example

    MessageBoard usage:  MessageBoard [userid] - where userid is optional and is a number representing a user whose messages will be blocked
    
    Chatter usage:  Chatter [userid] [username] - where both are optional, userid is a number representing a user whose messages will be blocked, username is any string
    

Running C/C#/ISO C++ 2/Java examples on Windows

Environment Setup

Let's call OpenSplice_install_dir the OpenSplice installation directory.

The OpenSplice environment variables must be set in order for the examples to run correctly. To do this open an OpenSplice Command Prompt which will set up the environment variables for OpenSplice automatically. The OpenSplice Command Prompt can be selected from the start menu. Alternatively, open a windows Command Prompt and execute the "OpenSplice_install_dir\release.bat" batch script supplied with the distribution.

C/C++/C#/ISO C++ 2 Executables

Building the examples is described on the Summary page

Executables and a libraries are generated in the examples build/bin directory when the example is built:

For C#

For C