Starting qserve and nserve - start_qnserves

Cogent Tools Demo and Tutorials: Version 4.0
Prev | Chapter 9. Common Functions for Any Program (in `lib/common.g`) | Next

# 9.3. Starting qserve and nserve - `start_qnserves`

The Cogent API utilities qserve and nserve support interprocess communication, and must be started before any IPC is performed within the demo. Due to underlying differences in QNX 4 and QNX 6 OS architecture, the program has to use different functions (wrapped by the abstracted function `anyos_find_process`) to see if the processes are already running, and then start the two utilities accordingly.

       /*--------------------------------------------------------------------
        * Function:    start_qnserves
        * Returns:     t on success, or nil
        * Description: Used to start qserve or nserve, as specified.
        *------------------------------------------------------------------*/
       function start_qnserves(command, name)
       {
         for(i=0; i<=50; i++)
           {
             if ((anyos_find_process(command, name) == nil))
               {
                 system(command);
                 usleep(10000);
               }
             else
               {
                 i = 50;
                 nil;
               }
           }
       }

Prev | Home | Next
Starting Programs - `program_startup` | Up | Control Button Functionality - `start_stop`

Copyright 1995-2002 by Cogent Real-Time Systems, Inc.