DR_ApInitIPC

DR_ApInitIPC — opens the connection to the driver.

Syntax

#include <cogent.h>
int DR_ApInitIPC(char*  taskname,
  char*  admin_name);

Arguments

taskname

The name of the user's application. It can be any unique name in the system's namespace.

admin_name

The taskname of the driver (see drcif_ad in the respective Cogent Driver manual). The driver PID can also be used.

Returns

The integer value 0 (DR_API_OK) if the IPC system initialized successfully, otherwise the following error may be reported:

DR_API_ERROR

Description

This function opens the connection to the driver. If the Cascade NameServer (nserve) is available, then it is used to locate the driver by name, otherwise the QNX nameloc service is used. Send and reply message buffers are created with a default size of 2048 bytes. Subsequent IPC messages greater than 2048 bytes in length will be truncated.

Example:

char		*taskname = "dr_test";
char		*admin_name = "/dr/cif";

if (argc > 1)
{
        taskname = argv[1];
        if (argc > 2)
	          admin_name = argv[2];
}

if (!DR_ApInitIPC (taskname, admin_name))
{
        printf ("Successfully connected %s to %s\n\n",
                 taskname, admin_name);
}
else
        printf ("Failed to connect %s to %s\n", argv[0], argv[1]);