FACT++  1.0
test_server1.c
Go to the documentation of this file.
1 #include <string.h>
2 #include <stdlib.h>
3 #include <stdio.h>
4 #include <dis.h>
5 
6 int Data1[4000];
7 int Data2[4000];
8 int Id1, Id2;
9 
10 void cmnd_rout(int *tag, char *buf, int *size)
11 {
12  int cid[2];
13 
14  cid[0] = dis_get_conn_id();
15  cid[1] = 0;
16  if(*tag == 1)
18  else if(*tag == 2)
20 }
21 
22 int main(int argc, char **argv)
23 {
24  int i, id, *ptr;
25  char aux[80];
26  char name[84], name1[132];
27  int on = 0;
28  long dnsid = 0;
29  char extra_dns[128];
30  int new_dns = 0;
31 /*
32  int buf_sz, buf_sz1;
33 */
34 
36 
37  i = 0;
38  Data1[0] = i;
39  Id1 = dis_add_service( "Beam1/Data", "C", Data1, 4000, (void *)0, 0 );
40  dis_add_cmnd("Beam1/Cmd","C",cmnd_rout, 1);
41  Data2[0] = i;
42  Id2 = dis_add_service( "Beam2/Data", "C", Data2, 4000, (void *)0, 0 );
43  dis_add_cmnd("Beam2/Cmd","C",cmnd_rout, 2);
44 
45  dis_start_serving( argv[1] );
46 
47  while(1)
48  {
49  usleep(1000);
50  i++;
51  Data1[0] = i;
53  Data2[0] = i;
55  }
56  return 1;
57 }
58 
int main(int argc, char **argv)
Definition: test_server1.c:22
#define dis_selective_update_service
Definition: dis.h:24
int Id1
Definition: test_server1.c:8
int Id2
Definition: test_server1.c:8
int i
Definition: db_dim_client.c:21
char id[4]
Definition: FITS.h:71
int dis_get_conn_id()
Definition: dis.c:2795
int Data1[4000]
Definition: test_server1.c:6
#define dis_add_cmnd
Definition: dis.h:13
#define dis_start_serving
Definition: dis.h:8
#define dis_update_service
Definition: dis.h:18
void cmnd_rout(int *tag, char *buf, int *size)
Definition: test_server1.c:10
int size
Definition: db_dim_server.c:17
char extra_dns[128]
Definition: README_v19.txt:369
#define dis_add_service
Definition: dis.h:12
dnsid
Definition: README_v19.txt:372
int Data2[4000]
Definition: test_server1.c:7
void dis_set_debug_on()
Definition: dis.c:181