71{
72
73 char* roisw = m_conf->getconf("roisender", "enabled");
74 if (nsmm->len > 0) {
75 roisw = (char*) nsmm->datap;
76 printf("Configure: roisender enable flag is overridden : %s\n", roisw);
77 }
78 if (strstr(roisw, "yes") == 0) return 0;
79
80
81 char* merger = m_conf->getconf("roisender", "merger");
82 char* mergerport = m_conf->getconf("roisender", "mergerport");
83 char* mergerhost = m_conf->getconf("roisender", "mergerhost");
84 char* onsenhost = m_conf->getconf("roisender", "onsenhost");
85 char* onsenport = m_conf->getconf("roisender", "onsenport");
86
87 string shmname = string(m_conf->getconf("system", "unitname")) + ":" +
88 string(m_conf->getconf("roisender", "nodename"));
89
90
91 if (strstr(merger, "none") == 0) {
92 char idbuf[3];
93 sprintf(idbuf, "%2.2d", RF_ROI_ID);
94 m_pid_merger = m_proc->
Execute(merger, (
char*)shmname.c_str(), idbuf, onsenhost, onsenport, mergerport);
95 sleep(2);
96 }
97
98
99 char* sender = m_conf->getconf("roisender", "sender");
100 int nqueue = m_conf->getconfi("roisender", "nqueues");
101
102
103 char* arglist[20];
104 arglist[0] = mergerhost;
105 arglist[1] = mergerport;
106 int nargs = 2;
107 char roiqs[10][256];
108 for (int i = 0; i < nqueue; i++) {
109 sprintf(roiqs[i], "/roi%d", i);
110 arglist[i + 2] = roiqs[i];
111 nargs++;
112 }
113
114 m_pid_sender = m_proc->
Execute(sender, nargs, arglist);
115
116 return 0;
117
118}
int Execute(char *script, int nargs, char **args)