Bugzilla – Bug 1833
The corresponding endpoint is not deallocated when a UDP socket is closed.
Last modified: 2014-01-20 12:42:01 EST
Created attachment 1759 [details] possible fix The attached patch is based on the TCP socket implementation.
Created attachment 1765 [details] possible fix Updated patch to align with commit 10575.
Hi Tom, I think we mixed the bugs here. I don't agree on deallocating the endpoints on ShutdownSend (the socket could be still in use to receive), but I do agree on a part I forgot in bug #1739 fix: deleting the socket from UdpL4Protocol. As a consequence, I'd keep from the obsoleted patch these lines: + std::vector<Ptr<UdpSocketImpl> >::iterator it + = std::find (m_udp->m_sockets.begin (), m_udp->m_sockets.end (), this); + if (it != m_udp->m_sockets.end ()) + { + m_udp->m_sockets.erase (it); + } and + std::vector<Ptr<UdpSocketImpl> >::iterator it + = std::find (m_udp->m_sockets.begin (), m_udp->m_sockets.end (), this); + if (it != m_udp->m_sockets.end ()) + { + m_udp->m_sockets.erase (it); + } in UdpSocketImpl::DeallocateEndPoint () Cheers, T.
> I don't agree on deallocating the endpoints on ShutdownSend (the socket > could be still in use to receive), but I do agree on a part I forgot in bug > #1739 fix: deleting the socket from UdpL4Protocol. Tommaso, You're correct. Please disregard the second patch, I somehow mixed things up when merging. Thanks for looking at this. Tom