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

Definition at line 106 of file test_server_priorities.c.

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

109 {
110  int i, j, id, *ptr;
111  char aux[80];
112  char name[84], *ptrc;
113 
116  for(i = 0; i< 10; i++)
117  {
118  sprintf(str[i],"%s/Service_%03d",argv[1],i);
119  dis_add_service( str[i], "C", str[i], strlen(str[i])+1,
120  (void *)0, 0 );
121  }
122  t.i = 123;
123  t.j = 123;
124  t.k = 123;
125  t.d = 56.78;
126  t.s = 12;
127  t.t = 12;
128  t.c = 'a';
129  t.f = 4.56;
130  ptr = (int *)&t;
131  strcpy(t.str,"hello world");
132 
133  sprintf(aux,"%s/TEST_SWAP",argv[1]);
134  id = dis_add_service( aux, "l:3;d:1;s:1;c:1;s:1;f:1;c:20", &t, sizeof(t),
135  (void *)0, 0 );
136 
137  sprintf(aux,"%s/TEST_CMD",argv[1]);
138  dis_add_cmnd(aux,"l:3;d:1;s:1;c:1;s:1;f:1;c:20",cmnd_rout, 0);
139 
140  dis_add_cmnd("taskManager/sendKill","I",kill_rout, 0);
141  dis_start_serving( argv[1] );
142 /*
143  {
144  int prio = -1, ret, pclass = -1;
145  dim_get_scheduler_class(&pclass);
146  printf("Process class: %d\n",pclass);
147  dim_get_priority(1, &prio);
148  printf("Main Thread: %d\n",prio);
149  dim_get_priority(2, &prio);
150  printf("IO Thread: %d\n",prio);
151  dim_get_priority(3, &prio);
152  printf("Timer Thread: %d\n",prio);
153 #ifndef WIN32
154  ret = dim_set_scheduler_class(2);
155  printf("ret = %d\n",ret);
156  ret = dim_set_priority(1, 20);
157  printf("ret = %d\n",ret);
158  ret = dim_set_priority(2, 50);
159  printf("ret = %d\n",ret);
160 #endif
161  dim_get_scheduler_class(&pclass);
162  printf("Process class: %d\n",pclass);
163  dim_get_priority(1, &prio);
164  printf("Main Thread: %d\n",prio);
165  dim_get_priority(2, &prio);
166  printf("IO Thread: %d\n",prio);
167  dim_get_priority(3, &prio);
168  printf("Timer Thread: %d\n",prio);
169  }
170 */
171  if(dis_get_client(name))
172  {
173  printf("client %s\n",name);
174  }
175 
176  while(1)
177  {
178  pause();
179  }
180 /*
181  sleep(5);
182  {
183  int i;
184  for(i = 0; i <= 999999999; i++);
185  }
186  printf("Normal Exit\n");
187 */
188 }
char str[10][80]
void client_exited(int *tag)
char str[20]
Definition: test_client.c:23
float f
Definition: test_client.c:22
void exit_cmnd(int *code)
int i
Definition: db_dim_client.c:21
char id[4]
Definition: FITS.h:71
short s
Definition: test_client.c:19
#define dis_add_cmnd
Definition: dis.h:13
#define dis_start_serving
Definition: dis.h:8
char c
Definition: test_client.c:20
int i
Definition: test_client.c:15
short t
Definition: test_client.c:21
int j
Definition: test_client.c:16
void cmnd_rout(int *tag, TT *buf, int *size)
#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)

+ Here is the call graph for this function: