FACT++  1.0
int main ( void  )

Definition at line 123 of file test_server.cxx.

References add_serv(), add_serv_bool(), add_serv_str(), extraDns, DimUtil::getEnvVar(), new_servint, DimServer::start(), and DimService::updateService().

124 {
125  int ival = 0;
126 // ErrorHandler errHandler;
127 // ExitHandler exHandler;
128 // DimServer::setDnsNode("axdes2.cern.ch");
129  string s1;
130  bool boolval;
131  ServWithHandler *testServ;
132  DimServerDns *newDns;
133  char *extraDns = 0;
135 
136 // DimService *dim = new DimService("test","C");
137 // delete dim;
138 
139  DimServer::start("TEST");
140  extraDns = DimUtil::getEnvVar((char *)"EXTRA_DNS_NODE");
141  if(extraDns)
142  newDns = new DimServerDns(extraDns, 0, (char *)"new_TEST");
143 
144 // int i, arr[15000];
145 // DimService *servp;
146 // DimCommand *cmndp;
147 // char str[132];
148 
149 // float farr[4];
150 // DimService *farrp;
151 
152  s1 = "hello";
153  add_serv(ival);
154  DimService servint("TEST/INTVAL",ival);
155 
156  if(extraDns)
157  {
158  new_servint = new DimService(newDns, "new_TEST/INTVAL",ival);
159  }
160 
161  add_serv_str(s1);
162  boolval = 0;
163  add_serv_bool(boolval);
164  CmndServ cmdsvr;
165 
166  testServ = new ServWithHandler((char *)"MY_NEW_TEST_SERVICE_WITH_HANDLER");
167  if(testServ){}
168 
169  // farr[0] = 1.2;
170 // farr[1] = 2.3;
171 // farrp = new DimService("/PCITCO147/sensors/fan/input","F", farr, sizeof(farr));
172 
173 
174 // DimServer::autoStartOff();
175 // DimServer::start("TEST");
176 
177 // for(i = 0; i < 15000; i++)
178 // {
179 // arr[i] = i;
180 // sprintf(str,"ServiceManyTest/%05d",i);
181 // servp = new DimService(str,arr[i]);
182 // servp->setQuality(1);
183 // servp->updateService(arr[i]);
185 // sprintf(str,"CommandManyTest/%05d",i);
186 // cmndp = new CmndServMany(str);
188 // }
189 
190  while(1)
191  {
192  sleep(5);
193 
194 // while(cmdsvr.hasNext())
195 // {
196 // cmdsvr.getNext();
197 // cmdsvr.handleIt();
198 // }
199 
200  s1 = "hello1";
201  if(!boolval)
202  boolval = 1;
203  else
204  boolval = 0;
205  ival++;
206  bool_serv[1]->updateService();
207 
208 // int inCallback = DimServer::inCallback();
209 // cout << "main: In callback "<< inCallback << endl;
210  servint.updateService();
211  if(extraDns)
212  new_servint->updateService();
213  }
214  return 0;
215 }
DimService * new_servint
Definition: README_v19.txt:381
void add_serv(const int &ival)
Definition: test_server.cxx:85
static char * getEnvVar(char *varName)
Definition: dimcpp.cxx:118
void add_serv_bool(const bool &boolval)
int updateService()
Definition: discpp.cxx:1016
void add_serv_str(const string &s1)
Definition: test_server.cxx:93
static void start()
Definition: discpp.cxx:512
DimService * bool_serv[10]
char * extraDns
Definition: README_v19.txt:380

+ Here is the call graph for this function: