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

Function ACE_TMAIN

tests/security/ConcurrentAuthLimit/ConcurrentAuthLimit.cpp:211–348  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

209}
210
211int ACE_TMAIN(int argc, ACE_TCHAR* argv[])
212{
213 DDS::DomainParticipantFactory_var dpf = TheServiceParticipant->get_domain_participant_factory(argc, argv);
214
215 // Parse options.
216 OpenDDS::DCPS::String DDS_ROOT;
217 bool no_limit = false;
218
219 const char* value = ACE_OS::getenv("DDS_ROOT");
220 if (value) {
221 DDS_ROOT = value;
222 }
223
224 value = ACE_OS::getenv("no_limit");
225 if (value && strcmp(value, "true") == 0) {
226 no_limit = true;
227 }
228
229 ACE_DEBUG((LM_DEBUG, "DDS_ROOT = %C\n", DDS_ROOT.c_str()));
230 ACE_DEBUG((LM_DEBUG, "no_limit = %d\n", no_limit));
231
232 const DDS::DomainId_t domain = 4;
233 const RcHandle<RtpsDiscovery> disc = make_rch<RtpsDiscovery>("RtpsDiscovery");
234
235 if (!no_limit) {
236 disc->config()->max_participants_in_authentication(1);
237 }
238
239 // Create sockets for the SPDP writers.
240 GuidGenerator guid_generator;
241
242 GUID_t writer1_guid;
243 guid_generator.populate(writer1_guid);
244 writer1_guid.entityId = ENTITYID_SPDP_BUILTIN_PARTICIPANT_WRITER;
245 ACE_DEBUG((LM_DEBUG, "Writer1 guid is %C\n", LogGuid(writer1_guid).c_str()));
246 SequenceNumber writer1_sequence;
247
248 const ACE_INET_Addr writer1_addr(u_short(7575), "0.0.0.0");
249 ACE_SOCK_Dgram writer1_socket;
250 if (writer1_socket.open(writer1_addr)) {
251 ACE_ERROR((LM_ERROR, ACE_TEXT("ERROR: failed to open writer1 socket\n")));
252 return EXIT_FAILURE;
253 }
254
255 GUID_t writer2_guid;
256 guid_generator.populate(writer2_guid);
257 writer2_guid.entityId = ENTITYID_SPDP_BUILTIN_PARTICIPANT_WRITER;
258 ACE_DEBUG((LM_DEBUG, "Writer2 guid is %C\n", LogGuid(writer2_guid).c_str()));
259 SequenceNumber writer2_sequence;
260
261 const ACE_INET_Addr writer2_addr(u_short(7576), "0.0.0.0");
262 ACE_SOCK_Dgram writer2_socket;
263 if (writer2_socket.open(writer2_addr)) {
264 ACE_ERROR((LM_ERROR, ACE_TEXT("ERROR: failed to open writer2 socket\n")));
265 return EXIT_FAILURE;
266 }
267
268 NetworkAddress multicast_address;

Callers

nothing calls this directly

Calls 15

LogGuidFunction · 0.85
receiveFunction · 0.85
participant_dataFunction · 0.85
make_part_guidFunction · 0.85
populateMethod · 0.80
to_addrMethod · 0.80
set_securityMethod · 0.80
add_discoveryMethod · 0.80
set_default_discoveryMethod · 0.80

Tested by

no test coverage detected