Skip to content

Commit

Permalink
single type builtin endpoints when possible
Browse files Browse the repository at this point in the history
  • Loading branch information
alberto committed Apr 25, 2019
1 parent ea8df17 commit a26b943
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/cpp/rtps/builtin/discovery/endpoint/EDPSimple.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,13 @@ bool EDPSimple::createSEDPEndpoints()
publications_listener_ = new EDPSimplePUBListener(this);
subscriptions_listener_ = new EDPSimpleSUBListener(this);

if(m_discovery.m_simpleEDP.use_PublicationWriterANDSubscriptionReader)
std::vector<std::string> names= this->mp_PDP->getRTPSParticipant()->getParticipantNames();
std::string this_name = names.front();

// These first pair of builtin endpoints is required only for nodes that publish data
// "arequipa" node does not publish
if(this_name != "arequipa")
//if(m_discovery.m_simpleEDP.use_PublicationWriterANDSubscriptionReader)
{
hatt.initialReservedCaches = edp_initial_reserved_caches;
hatt.payloadMaxSize = DISCOVERY_PUBLICATION_DATA_MAX_SIZE;
Expand Down Expand Up @@ -217,7 +223,10 @@ bool EDPSimple::createSEDPEndpoints()
subscriptions_reader_.second = nullptr;
}
}
if(m_discovery.m_simpleEDP.use_PublicationReaderANDSubscriptionWriter)
// These second pair of builtin endpoints is required only for nodes that subscribe to data
// "montreal" node does not subscribe
if(this_name != "montreal")
//if(m_discovery.m_simpleEDP.use_PublicationReaderANDSubscriptionWriter)
{
hatt.initialReservedCaches = edp_initial_reserved_caches;
hatt.payloadMaxSize = DISCOVERY_PUBLICATION_DATA_MAX_SIZE;
Expand Down

0 comments on commit a26b943

Please sign in to comment.