source: branches/testFACT++branch/dim/src/benchmark/benchServer.cxx@ 20115

Last change on this file since 20115 was 14936, checked in by tbretz, 12 years ago
Changed to v20r5.
File size: 707 bytes
Line 
1#include <iostream>
2#include <dis.hxx>
3#ifdef WIN32
4#include <process.h>
5#endif
6#include <stdio.h>
7
8int main(int argc, char *argv[])
9{
10 int i, msgSize, nServices, pid;
11 char *msg, servName[64];
12 DimService **services;
13
14 if(argc){}
15 sscanf(argv[1],"%d",&msgSize);
16 sscanf(argv[2],"%d",&nServices);
17 msg = new char[msgSize];
18 services = new DimService*[nServices];
19
20 pid = getpid();
21 for(i = 0; i < nServices; i++)
22 {
23 sprintf(servName,"BENCH_SERVICE_%d_%03d",pid, i);
24 services[i] = new DimService(servName, "C", msg, msgSize);
25 }
26 sprintf(servName,"BENCH_%d",pid);
27 DimServer::start(servName);
28 while(1)
29 {
30 for(i = 0; i < nServices; i++)
31 {
32 services[i]->updateService();
33 }
34 }
35 return 0;
36}
Note: See TracBrowser for help on using the repository browser.