int tt_out(char * key,value_t vt) { int ecode; int rt = 0; TCRDB * rdb = tcrdbnew(); int db_port = get_db_port(vt); printf("db_port -- %d\n",db_port); if(!tcrdbopen(rdb,LOCALHOST,db_port)) { ecode = tcrdbecode(rdb); fprintf(stderr,"tt_out:open %s error -- %s\n",db_port,tcrdberrmsg(ecode)); rt = 1; } else { printf("db open success!\n"); if(tcrdbout2(rdb,key)) { printf("(key=%s) tt_out success!\n",key); } else { ecode = tcrdbecode(rdb); fprintf(stderr,"(key=%s) tt_out error:%s\n",key,tcrdberrmsg(ecode)); rt = 2; } } tcrdbdel(rdb); return rt; }
bool db_obj_remote::dbout2(const char *kstr) { return tcrdbout2(_hdb,kstr); }