1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
|
/* -*- C++ -*- */
// $Id$
// NOTE: If you encounter trouble resolving the Naming Service, try
// running the Naming Service and the server in the same window. [MJB]
#if !defined (TAO_AV_BENCH_SERVER_H)
#define TAO_AV_BENCH_SERVER_H
#include "ace/Get_Opt.h"
#include "ace/Acceptor.h"
#include "ace/Svc_Handler.h"
#include "ace/SOCK_Acceptor.h"
#include "ace/INET_Addr.h"
#include "ace/SOCK_CODgram.h"
#include "ace/Select_Reactor.h"
#include "orbsvcs/orbsvcs/Naming/Naming_Utils.h"
#include "orbsvcs/AV/AVStreams_i.h"
#include "orbsvcs/AV/Endpoint_Strategy.h"
#include "client.h"
#include "child.h"
class AV_Server_Sig_Handler
: public virtual ACE_Event_Handler
{
public:
AV_Server_Sig_Handler (void);
virtual ACE_HANDLE get_handle (void) const;
int register_handler (void);
// this will register this sig_handler
// with the reactor for SIGCHLD,SIGTERM,SIGINT
virtual int shutdown (ACE_HANDLE,
ACE_Reactor_Mask);
virtual int handle_input (ACE_HANDLE);
// handle input on the dummy handle.
virtual int handle_signal (ACE_HANDLE signum,
siginfo_t * = 0,
ucontext_t* = 0);
// handles the SIGCHLD,SIGTERM,SIGINT for the parent process i.e
// the main thread..
~AV_Server_Sig_Handler (void);
// Destructor
private:
ACE_HANDLE handle_;
// dummy handle for the sig handler.
ACE_Sig_Set sig_set;
};
class Server
{
public:
Server (void);
// Default constructor
int init (int argc,
char **argv,
CORBA::Environment& env);
int run (CORBA::Environment& env);
~Server (void);
private:
TAO_ORB_Manager orb_manager_;
// the TAO ORB manager.
TAO_Naming_Client my_name_client_;
// The TAO Naming server
//CosNaming::NamingContext_var naming_context_;
// The root naming context of the naming service
// AV_Server_Sig_Handler signal_handler_;
ACE_Process_Options process_options_;
// The process options for the process to be spawned by the process strategy
// TAO_AV_Endpoint_Process_Strategy_B process_strategy_;
// The proces strategy for the video.
TAO_AV_Endpoint_Reactive_Strategy_B <Bench_Server_StreamEndPoint,TAO_VDev,AV_Null_MediaCtrl> reactive_strategy_;
// Reactive strategy
TAO_MMDevice *mmdevice_;
// The video server multimedia device
};
#endif /* TAO_AV_BENCH_SERVER_H */
|