I want to develop C client code using the callin API.
I wrote code to connect to Cache. However, when I invoke it, I get ...
Instance is not running
Start status = -1
I am guessing that I am missing an environment variable to identify my default Cache instance, but I cannot find a reference to that in the Cache documentation.
I have a Suse based installation. I can start csession using "csession CACHE" in the same shell.
Any help?
Code is below....
static void *
mstart(void) {
int status = 0;
if (! gInitialised) {
CACHE_ASTR prinp, prout, exename;
prinp.len = prout.len = 0;
prinp.str[0] = prout.str[0] = '\0';
strcpy((char *)exename.str, "vavista.cache");
exename.len = strlen((const char *)exename.str);
status = CacheSecureStartA(
NULL, /* User */
NULL, /* Password */
&exename, /* Application Id */
CACHE_PROGMODE | CACHE_TTNEVER, /* Flags */
0, /* timeout */
&prinp, /* Principal input device */
&prout); /* Principal output device */
printf("Start status = %d\n", status);
atexit(mstop);
}
return (void *)1; /* Success */
}
You need to set the Cache Directory before starting... CacheSetDir("/opt/cache/mgr");