source: trunk/FACT++/dim/src/examples/test_big_client.c@ 20115

Last change on this file since 20115 was 11071, checked in by tbretz, 14 years ago
Replaced v19r21 by a version extracted with 'unzip -a' to get proper unix text format.
File size: 1.1 KB
Line 
1#include <dic.h>
2
3#define MAX_SERVICES 40000
4/*
5int Data[MAX_SERVICES];
6int Recvd[MAX_SERVICES];
7*/
8int no_link = -1;
9
10void rout(tag, buff, size)
11int *tag, *size;
12int *buff;
13{
14static int bad = 0;
15int i;
16static int n_recvd = 0;
17
18 if(!bad)
19 {
20 if (*buff == no_link)
21 {
22/*
23 for(i = 0; i < MAX_SERVICES; i++)
24 Recvd[i] = 0;
25*/
26 bad = 1;
27 n_recvd = 0;
28 }
29 }
30 if(bad)
31 {
32 if (*buff != no_link)
33 {
34/*
35 for(i = 0; i < MAX_SERVICES; i++)
36 Recvd[i] = 0;
37*/
38 bad = 0;
39 n_recvd = 0;
40 }
41 }
42/*
43 if(bad)
44 {
45 Recvd[*tag] = *buff;
46 }
47 else
48 {
49 Recvd[*tag] = (*buff)+1;
50 }
51*/
52 n_recvd++;
53/*
54 for(i = 0; i <= MAX_SERVICES; i++)
55 {
56 if(Recvd[i] != 0)
57 n_recvd++;
58 }
59*/
60/*
61 if(!((*tag) % 1000))
62*/
63
64 if(!(n_recvd % 1000))
65 printf("Received n = %d, %d = %d\n",n_recvd, *tag, *buff);
66}
67
68main(argc,argv)
69int argc;
70char **argv;
71{
72 int i;
73 char name[64];
74 int id = 123;
75
76 dic_set_dns_node("lxplus050.cern.ch");
77
78/*
79 dic_set_debug_on();
80*/
81 for(i = 0; i< MAX_SERVICES; i++)
82 {
83 sprintf(name,"%s/Service_%d",argv[2],i);
84 dic_info_service( name, TIMED, 0, 0, 0,
85 rout, i,&no_link, sizeof(no_link) );
86 }
87 while(1)
88 {
89 pause();
90 }
91}
Note: See TracBrowser for help on using the repository browser.