FACT++  1.0
test_server_slac.c
Go to the documentation of this file.
1 #include <stdio.h>
2 #include <dis.h>
3 #include <dic.h>
4 
5 char str[10][80];
6 
7 void rout( tag, buf, size )
8 char *buf;
9 int *tag, *size;
10 {
11  printf("%s Received for Server %d\n", buf, *tag);
12 }
13 
14 main(argc,argv)
15 int argc;
16 char **argv;
17 {
18  char aux[80];
19  int n;
20 
21  sscanf(argv[1], "%d", &n);
22  sprintf(aux,"TEST_SLAC/SRV%d",n);
23  sprintf(str[0], aux);
24  dis_add_service(aux, "C", str[0], strlen(str[0])+1, (void *)0, 0);
25  sprintf(aux,"TEST_SLAC/%d",n);
26  dis_start_serving(aux);
27  sprintf(aux,"TEST_SLAC/CLT%d",n);
28  dic_info_service( aux, TIMED, 60, 0, 0, rout, n,
29  "No Link", 8 );
30  while(1)
31  {
32  pause();
33  }
34 }
35 
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
void rout(int *tag, char *buf, int *size)
#define dis_start_serving
Definition: dis.h:8
main(int argc, char **argv)
int size
Definition: db_dim_server.c:17
#define dis_add_service
Definition: dis.h:12
#define TIMED
Definition: dim_common.h:8
char str[10][80]
sprintf(name1,"NewService%d", i)