FACT++  1.0
test_client_slac.c
Go to the documentation of this file.
1 #include <dic.h>
2 #include <dis.h>
3 #include <time.h>
4 
5 void rout( tag, buf, size )
6 char *buf;
7 int *tag, *size;
8 {
9  printf("%s Received for Server %d\n", buf, *tag);
10 }
11 
13 {
14  char str[80], aux[80];
15  int i;
16 
17  for(i = 0; i< 20; i++)
18  {
19  sprintf(str,"TEST_SLAC/SRV%d",i);
20  dic_info_service( str, TIMED, 60, 0, 0, rout, i,
21  "No Link", 8 );
22  }
23  for(i = 0; i< 20; i++)
24  {
25  sprintf(aux,"TEST_SLAC/CLT%d",i);
26  dis_add_service(aux, "C", aux, strlen(aux)+1, (void *)0, 0);
27  }
28  sprintf(aux,"TEST_SLAC/CLT");
29  dis_start_serving(aux);
30  while(1)
31  pause();
32 }
unsigned dic_info_service(char *serv_name, int req_type, int req_timeout, void *serv_address, int serv_size, void(*usr_routine)(), dim_long tag, void *fill_addr, int fill_size)
Definition: dic.c:601
main()
int i
Definition: db_dim_client.c:21
char str[80]
Definition: test_client.c:7
void rout(int *tag, char *buf, int *size)
#define dis_start_serving
Definition: dis.h:8
int size
Definition: db_dim_server.c:17
#define dis_add_service
Definition: dis.h:12
#define TIMED
Definition: dim_common.h:8
sprintf(name1,"NewService%d", i)