FACT++
1.0
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
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)
17
dis_selective_update_service
(
Id1
, cid);
18
else
if
(*tag == 2)
19
dis_selective_update_service
(
Id2
, cid);
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
35
dis_set_debug_on
();
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
;
52
dis_update_service
(
Id1
);
53
Data2
[0] =
i
;
54
dis_update_service
(
Id2
);
55
}
56
return
1;
57
}
58
dis.h
main
int main(int argc, char **argv)
Definition:
test_server1.c:22
dis_selective_update_service
#define dis_selective_update_service
Definition:
dis.h:24
Id1
int Id1
Definition:
test_server1.c:8
Id2
int Id2
Definition:
test_server1.c:8
i
int i
Definition:
db_dim_client.c:21
id
char id[4]
Definition:
FITS.h:71
dis_get_conn_id
int dis_get_conn_id()
Definition:
dis.c:2795
Data1
int Data1[4000]
Definition:
test_server1.c:6
dis_add_cmnd
#define dis_add_cmnd
Definition:
dis.h:13
dis_start_serving
#define dis_start_serving
Definition:
dis.h:8
dis_update_service
#define dis_update_service
Definition:
dis.h:18
cmnd_rout
void cmnd_rout(int *tag, char *buf, int *size)
Definition:
test_server1.c:10
size
int size
Definition:
db_dim_server.c:17
extra_dns
char extra_dns[128]
Definition:
README_v19.txt:369
dis_add_service
#define dis_add_service
Definition:
dis.h:12
dnsid
dnsid
Definition:
README_v19.txt:372
Data2
int Data2[4000]
Definition:
test_server1.c:7
dis_set_debug_on
void dis_set_debug_on()
Definition:
dis.c:181
dim
src
examples
test_server1.c
Generated on Sun Sep 18 2016 20:50:18 for FACT++ by
1.8.11