limit outgoing queue size

This commit is contained in:
orignal 2016-07-12 16:26:36 -04:00
parent 4ac4f44ba7
commit c664be52d7
2 changed files with 11 additions and 2 deletions

View file

@ -713,8 +713,16 @@ namespace transport
if (m_IsTerminated) return;
if (m_IsSending)
{
for (auto it: msgs)
m_SendQueue.push_back (it);
if (m_SendQueue.size () < NTCP_MAX_OUTGOING_QUEUE_SIZE)
{
for (auto it: msgs)
m_SendQueue.push_back (it);
}
else
{
LogPrint (eLogWarning, "NTCP: outgoing messages queue size exceeds ", NTCP_MAX_OUTGOING_QUEUE_SIZE);
Terminate ();
}
}
else
Send (msgs);