MCPcopy Create free account
hub / github.com/OpenDDS/OpenDDS / common_init

Method common_init

dds/InfoRepo/InfoRepoMulticastResponder.cpp:108–149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106}
107
108int
109InfoRepoMulticastResponder::common_init(
110 CORBA::ORB_ptr orb)
111{
112 orb_ = CORBA::ORB::_duplicate(orb);
113
114 if (this->response_addr_.set((u_short) 0) == -1)
115 ACE_ERROR_RETURN((LM_ERROR,
116 "InfoRepoMulticastResponder::common_init() %p\n",
117 ACE_TEXT("set")),
118 -1);
119
120 else if (this->response_.open(this->response_addr_) == -1) {
121 ACE_ERROR_RETURN((LM_ERROR,
122 "%p\n",
123 ACE_TEXT("set")),
124 -1);
125 }
126
127 // Use ACE_SOCK_Dgram_Mcast factory to subscribe to multicast group.
128#ifdef ACE_HAS_MAC_OSX
129 mcast_dgram_.opts(ACE_SOCK_Dgram_Mcast::OPT_BINDADDR_NO |
130 ACE_SOCK_Dgram_Mcast::DEFOPT_NULLIFACE);
131#endif
132 if (this->mcast_nic_.length() != 0) {
133 if (this->mcast_dgram_.join(this->mcast_addr_,
134 1,
135 ACE_TEXT_CHAR_TO_TCHAR(this->mcast_nic_.c_str())) == -1)
136 ACE_ERROR_RETURN((LM_ERROR, "InfoRepoMulticastResponder::common_init() %p\n",
137 ACE_TEXT("subscribe")), -1);
138
139 } else {
140 if (this->mcast_dgram_.join(this->mcast_addr_) == -1)
141 ACE_ERROR_RETURN((LM_ERROR,
142 "InfoRepoMulticastResponder::common_init() %p\n",
143 ACE_TEXT("subscribe")),
144 -1);
145 }
146
147 this->initialized_ = true;
148 return 0;
149}
150
151int
152InfoRepoMulticastResponder::handle_timeout(const ACE_Time_Value &,

Callers

nothing calls this directly

Calls 4

setMethod · 0.45
openMethod · 0.45
lengthMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected