From 4cf5ce871f32b91e66cdcd2dea71a0cd0c55690e Mon Sep 17 00:00:00 2001 From: orignal Date: Tue, 5 Jul 2016 17:52:11 -0400 Subject: [PATCH] destroy socket upon receive an ack for close --- Streaming.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Streaming.cpp b/Streaming.cpp index 0951a6f2..74046ef7 100644 --- a/Streaming.cpp +++ b/Streaming.cpp @@ -36,7 +36,6 @@ namespace stream Stream::~Stream () { - Terminate (); while (!m_ReceiveQueue.empty ()) { auto packet = m_ReceiveQueue.front (); @@ -302,7 +301,9 @@ namespace stream m_NumResendAttempts = 0; SendBuffer (); } - if (m_Status == eStreamStatusClosing) + if (m_Status == eStreamStatusClosed) + Terminate (); + else if (m_Status == eStreamStatusClosing) Close (); // check is all outgoing messages have been sent and we can send close }