Revision 155, 0.9 KB
(checked in by bhilburn, 15 years ago)
|
Implemented the old default policy engine in our new PolicyEngine? class. Doesn't
link properly due to redefinitions of socket functions... might need to change
the way that is laid out to fix it.
|
Line | |
---|
1 | /* Virginia Tech Cognitive Radio Open Source Systems |
---|
2 | * Virginia Tech, 2009 |
---|
3 | * |
---|
4 | * TODO LICENSE INFORMATION GOES HERE |
---|
5 | */ |
---|
6 | |
---|
7 | /* TODO DESCRIPTION OF FILE. |
---|
8 | * |
---|
9 | * This file is a temporary demo of a policy engine using some of our socket |
---|
10 | * communication functions. This is *not* an actual implementation of our |
---|
11 | * defined PolicyEngine class. |
---|
12 | */ |
---|
13 | |
---|
14 | |
---|
15 | #include <cstdlib> |
---|
16 | #include <cstring> |
---|
17 | #include <stdint.h> |
---|
18 | |
---|
19 | #include "vtcross/common.h" |
---|
20 | #include "vtcross/components.h" |
---|
21 | #include "vtcross/containers.h" |
---|
22 | #include "vtcross/socket_comm.h" |
---|
23 | |
---|
24 | |
---|
25 | #define CR_PORT 30002 |
---|
26 | |
---|
27 | |
---|
28 | int32_t |
---|
29 | main(int32_t argc, char *argv[]) |
---|
30 | { |
---|
31 | if(argc < 3) |
---|
32 | ERROR(1, "Usage: %s hostname port\n", argv[0]); |
---|
33 | |
---|
34 | int32_t socketFD = ClientSocket(argv[1], argv[2]); |
---|
35 | |
---|
36 | PolicyEngine policyEngine; |
---|
37 | policyEngine.RegisterComponent(socketFD); |
---|
38 | |
---|
39 | while(1) { |
---|
40 | policyEngine.WaitForSignal(socketFD); |
---|
41 | } |
---|
42 | |
---|
43 | return 0; |
---|
44 | } |
---|
45 | |
---|