FACT++  1.0
main ( int  argc,
char **  argv 
)

Definition at line 56 of file test_server_many.c.

References TT::c, client_exited(), TT::d, dis_add_client_exit_handler, dis_add_exit_handler, dis_add_service, dis_get_client, dis_start_serving, dtq_start_timer(), exit_cmnd(), TT::f, TT::i, i, id, TT::j, TT::k, TT::s, ServMany, ServManyIds, sprintf(), str, TT::str, TT::t, and update_services().

59 {
60  int i, j, id, *ptr;
61  char aux[80];
62  char name[84], *ptrc;
63  int big_ids[20];
64  int index = 0;
65  char straux[128];
66  void update_services();
67 
70  for(i = 0; i< 10; i++)
71  {
72  sprintf(str[i],"%s/Service_%03d",argv[1],i);
73  dis_add_service( str[i], "C", str[i], strlen(str[i])+1,
74  (void *)0, 0 );
75  }
76  t.i = 123;
77  t.j = 123;
78  t.k = 123;
79  t.d = 56.78;
80  t.s = 12;
81  t.t = 12;
82  t.c = 'a';
83  t.f = 4.56;
84  ptr = (int *)&t;
85  strcpy(t.str,"hello world");
86 /*
87  sprintf(aux,"%s/TEST_SWAP",argv[1]);
88  id = dis_add_service( aux, "l:3;d:1;s:1;c:1;s:1;f:1;c:20", &t, sizeof(t),
89  (void *)0, 0 );
90 
91  sprintf(aux,"%s/TEST_CMD",argv[1]);
92  dis_add_cmnd(aux,"l:3;d:1;s:1;c:1;s:1;f:1;c:20",cmnd_rout, 0);
93 */
94 /*
95  big_buff[0] = 1;
96  for(i = 0; i < 20; i++)
97  {
98  sprintf(aux,"%s/TestMem_%d",argv[1], i);
99  big_ids[i] = dis_add_service( aux, "I", big_buff, 1024*sizeof(int),
100  (void *)0, 0 );
101  }
102 */
103  for(i = 0; i< 100000; i++)
104  {
105  ServMany[i] = i;
106  sprintf(straux,"%s/ServiceMany%05d",argv[1],i);
107  ServManyIds[i] = dis_add_service( straux, "D", &ServMany[i], sizeof(double),
108  (void *)0, 0 );
109  }
110  dis_start_serving( argv[1] );
111  if(dis_get_client(name))
112  {
113  printf("client %s\n",name);
114  }
115 
117 
118  while(1)
119  {
120 /*
121  for(i = 0; i < 20; i++)
122  {
123  index++;
124  big_buff[0] = index;
125  dis_update_service(big_ids[i]);
126  }
127  sleep(1);
128 */
129  pause();
130 /*
131  sleep(30);
132  update_services();
133 */
134  }
135 }
char str[20]
Definition: test_client.c:23
int ServManyIds[100000]
float f
Definition: test_client.c:22
void exit_cmnd(int *code)
char str[10][80]
int i
Definition: db_dim_client.c:21
char id[4]
Definition: FITS.h:71
void update_services()
short s
Definition: test_client.c:19
void dtq_start_timer(int time, void(*user_routine)(), dim_long tag)
Definition: dtq.c:790
#define dis_start_serving
Definition: dis.h:8
TT t
char c
Definition: test_client.c:20
int i
Definition: test_client.c:15
short t
Definition: test_client.c:21
double ServMany[100000]
int j
Definition: test_client.c:16
#define dis_get_client
Definition: dis.h:11
int k
Definition: test_client.c:17
double d
Definition: test_client.c:18
#define dis_add_service
Definition: dis.h:12
#define dis_add_exit_handler
Definition: dis.h:15
#define dis_add_client_exit_handler
Definition: dis.h:14
sprintf(name1,"NewService%d", i)
void client_exited(int *tag)

+ Here is the call graph for this function: