Last change
on this file since 13913 was 11071, checked in by tbretz, 13 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 | /*
|
---|
5 | int Data[MAX_SERVICES];
|
---|
6 | int Recvd[MAX_SERVICES];
|
---|
7 | */
|
---|
8 | int no_link = -1;
|
---|
9 |
|
---|
10 | void rout(tag, buff, size)
|
---|
11 | int *tag, *size;
|
---|
12 | int *buff;
|
---|
13 | {
|
---|
14 | static int bad = 0;
|
---|
15 | int i;
|
---|
16 | static 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 |
|
---|
68 | main(argc,argv)
|
---|
69 | int argc;
|
---|
70 | char **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.