1
我想使用callin API開發C客戶端代碼。Intersystems緩存 - Callin API入門
我寫了代碼連接到緩存。然而,當我調用它,我得到...
Instance is not running
Start status = -1
我猜測,我缺少一個環境變量,以確定我的默認緩存實例,但我找不到緩存文檔中一個參考。
我有一個基於Suse的安裝。我可以在同一個shell中使用「csession CACHE」啓動會話。
任何幫助?
代碼如下....
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 */
}
我工作過。我需要在開始之前設置緩存目錄... CacheSetDir(「/ opt/cache/mgr」); –