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

Method transport_assoc_done

dds/DCPS/DataReaderImpl.cpp:352–438  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

350}
351
352void
353DataReaderImpl::transport_assoc_done(int flags, const GUID_t& remote_id)
354{
355 if (!(flags & ASSOC_OK)) {
356 if (DCPS_debug_level) {
357 ACE_ERROR((LM_ERROR,
358 ACE_TEXT("(%P|%t) DataReaderImpl::transport_assoc_done: ")
359 ACE_TEXT("ERROR: transport layer failed to associate local reader %C remote writer %C\n"),
360 LogGuid(get_guid()).c_str(),
361 LogGuid(remote_id).c_str()));
362 }
363 return;
364 }
365
366 const RcHandle<DomainParticipantImpl> participant = participant_servant_.lock();
367
368 if (!participant)
369 return;
370
371 const DDS::InstanceHandle_t handle = participant->assign_handle(remote_id);
372
373 if (!is_bit_) {
374 // We acquire the publication_handle_lock_ for the remainder of our
375 // processing.
376 {
377 ACE_GUARD(ACE_Recursive_Thread_Mutex, guard, publication_handle_lock_);
378
379 // This insertion is idempotent.
380 publication_id_to_handle_map_.insert(RepoIdToHandleMap::value_type(remote_id, handle));
381
382 if (DCPS_debug_level > 4) {
383 ACE_DEBUG((LM_DEBUG,
384 ACE_TEXT("(%P|%t) DataReaderImpl::transport_assoc_done: ")
385 ACE_TEXT("id_to_handle_map_[ %C] = 0x%x.\n"),
386 LogGuid(remote_id).c_str(),
387 handle));
388 }
389
390 // We need to adjust these after the insertions have all completed
391 // since insertions are not guaranteed to increase the number of
392 // currently matched publications.
393 const int matchedPublications = static_cast<int>(publication_id_to_handle_map_.size());
394 subscription_match_status_.current_count_change =
395 matchedPublications - subscription_match_status_.current_count;
396 subscription_match_status_.current_count = matchedPublications;
397
398 ++subscription_match_status_.total_count;
399 ++subscription_match_status_.total_count_change;
400
401 subscription_match_status_.last_publication_handle = handle;
402
403 set_status_changed_flag(DDS::SUBSCRIPTION_MATCHED_STATUS, true);
404
405 DDS::DataReaderListener_var listener =
406 listener_for(DDS::SUBSCRIPTION_MATCHED_STATUS);
407
408 if (!CORBA::is_nil(listener)) {
409 listener->on_subscription_matched(this, subscription_match_status_);

Callers

nothing calls this directly

Calls 11

LogGuidFunction · 0.85
get_guidFunction · 0.85
assign_handleMethod · 0.80
lockMethod · 0.45
insertMethod · 0.45
sizeMethod · 0.45
findMethod · 0.45
endMethod · 0.45
reportMethod · 0.45

Tested by

no test coverage detected