13.3.2.6. IPC Initialization

Before any form of Cogent interprocess communication occurs there must be a call to the init_ipc function. This function opens the channels of communications between Gamma and other tasks powered by Gamma, Cascade Connect, or other Cogent products. With this function you determine your task's name and optionally its queue name and domain.

A program's name is the string registered with the nserve program. Gamma names and queue names for tasks should be unique on the network. A program's queue name is the name of the queue that is registered if it wants to participate in asynchronous communication using Cogent's qserve utilities. The domain name is the name of the default DataHub domain from which to read and write points.

It is typical to find the init_ipc function called within the first few calls in the program. Here's an example:

#!/usr/local/bin/gamma
require_lisp("PhotonWidget");
require_lisp("PhabTemplate");

myname = car(argv);
init_ipc("myname");
		  

This program segment first defines the engine to run on the first line, then loads some required files for Photon widget manipulation and Photon Application Builder support. The argv variable holds the arguments passed to Gamma. The first item in the list is the name of the executable, which is put in the myname variable. The init_ipc function is then called with the registered name being whatever the name of the program happens to be.