Skip to content

Commit

Permalink
Refs #7478. Creating send buffers after receiver resources.
Browse files Browse the repository at this point in the history
  • Loading branch information
MiguelCompany committed Feb 17, 2020
1 parent 8918375 commit 0b9bac5
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions src/cpp/rtps/participant/RTPSParticipantImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,19 +264,6 @@ RTPSParticipantImpl::RTPSParticipantImpl(
m_att.defaultMulticastLocatorList.clear();
}

bool allow_growing_buffers = m_att.allocation.send_buffers.dynamic;
size_t num_send_buffers = m_att.allocation.send_buffers.preallocated_number;
if (num_send_buffers == 0)
{
// Three buffers (user, events and async writer threads)
num_send_buffers = 3;
// Add one buffer per reception thread
num_send_buffers += m_receiverResourcelist.size();
}

// Create buffer pool
send_buffers_.reset(new SendBuffersManager(num_send_buffers, allow_growing_buffers));

#if HAVE_SECURITY
// Start security
// TODO(Ricardo) Get returned value in future.
Expand All @@ -295,7 +282,18 @@ RTPSParticipantImpl::RTPSParticipantImpl(
createReceiverResources(m_att.defaultUnicastLocatorList, true, false);
createReceiverResources(m_att.defaultMulticastLocatorList, true, false);

// Allocate all pending send buffers
bool allow_growing_buffers = m_att.allocation.send_buffers.dynamic;
size_t num_send_buffers = m_att.allocation.send_buffers.preallocated_number;
if (num_send_buffers == 0)
{
// Three buffers (user, events and async writer threads)
num_send_buffers = 3;
// Add one buffer per reception thread
num_send_buffers += m_receiverResourcelist.size();
}

// Create buffer pool
send_buffers_.reset(new SendBuffersManager(num_send_buffers, allow_growing_buffers));
send_buffers_->init(this);

#if HAVE_SECURITY
Expand Down

0 comments on commit 0b9bac5

Please sign in to comment.