OpenDDS  Snapshot(2023/04/28-20:55)
InfoRepoMulticastResponder.h
Go to the documentation of this file.
1 /*
2  *
3  *
4  * Distributed under the OpenDDS License.
5  * See: http://www.opendds.org/license.html
6  */
7 
8 #ifndef INFOREPOMULTICASTRESPONDER_H
9 #define INFOREPOMULTICASTRESPONDER_H
10 
11 #include /**/ "ace/pre.h"
12 
13 #include "federator_export.h"
14 #include "tao/ORB.h"
15 
16 #if !defined (ACE_LACKS_PRAGMA_ONCE)
17 # pragma once
18 #endif /* ACE_LACKS_PRAGMA_ONCE */
19 
20 #include "ace/INET_Addr.h"
21 #include "ace/SOCK_Dgram_Mcast.h"
22 #include "ace/Reactor.h"
23 #include "ace/SString.h"
24 
26 
28 
29 namespace OpenDDS {
30 namespace Federator {
31 
32 /**
33  * @class InfoRepoMulticastResponder
34  *
35  * @brief Event Handler that services multicast requests for IOR of a
36  * bootstrappable service.
37  *
38  * This class uses the ACE_SOCK_Dgram_Mcast class and should be
39  * registered with a reactor and should be initialized with the
40  * ior of the service to be multicasted.
41  */
43 public:
45 
46  virtual ~InfoRepoMulticastResponder();
47 
48  /// Initialization method.
49  int init(
50  CORBA::ORB_ptr orb,
51  u_short port,
52  const char *mcast_addr);
53 
54  /// Initialization method. Takes in "address:port" string as a
55  /// parameter.
56  int init(
57  CORBA::ORB_ptr orb,
58  const char *mcast_addr);
59 
60  /// Callback when input is received on the handle.
61  virtual int handle_input(ACE_HANDLE n);
62 
63  /// Callback when a timeout has occurred.
64  virtual int handle_timeout(const ACE_Time_Value &tv,
65  const void *arg);
66 
67  /// Returns the internal handle used to receive multicast.
68  virtual ACE_HANDLE get_handle() const;
69 
70 private:
71  /// Factor common functionality from the two init functions.
72  int common_init(
73  CORBA::ORB_ptr orb);
74 
75  /// Are we initialized?
77 
78  /// The ORB
80 
81  /// multicast endpoint of communication
83 
84  /// multicast address
86 
87  /// address of response.
89 
90  /// socket for response to the multicast
92 
94 };
95 
96 } // namespace Federator
97 } // namespace OpenDDS
98 
100 
101 #include /**/ "ace/post.h"
102 
103 #endif /* INFOREPOMULTICASTRESPONDER_H */
int init(void)
ACE_HANDLE get_handle(void)
#define OpenDDS_Federator_Export
ACE_SOCK_Dgram_Mcast mcast_dgram_
multicast endpoint of communication
Event Handler that services multicast requests for IOR of a bootstrappable service.
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
ACE_SOCK_Dgram response_
socket for response to the multicast
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28