|
38 |
#include "ipv4-end-point.h" |
38 |
#include "ipv4-end-point.h" |
39 |
#include "ipv6-end-point.h" |
39 |
#include "ipv6-end-point.h" |
40 |
#include <limits> |
40 |
#include <limits> |
|
|
41 |
#include <algorithm> |
41 |
|
42 |
|
42 |
NS_LOG_COMPONENT_DEFINE ("UdpSocketImpl"); |
43 |
NS_LOG_COMPONENT_DEFINE ("UdpSocketImpl"); |
43 |
|
44 |
|
|
180 |
m_endPoint6 = 0; |
181 |
m_endPoint6 = 0; |
181 |
} |
182 |
} |
182 |
|
183 |
|
|
|
184 |
void |
185 |
UdpSocketImpl::DeallocateEndPoint () |
186 |
{ |
187 |
NS_LOG_FUNCTION_NOARGS (); |
188 |
|
189 |
if (m_endPoint != 0) |
190 |
{ |
191 |
m_endPoint->SetDestroyCallback (MakeNullCallback<void> ()); |
192 |
m_udp->DeAllocate (m_endPoint); |
193 |
m_endPoint = 0; |
194 |
std::vector<Ptr<UdpSocketImpl> >::iterator it |
195 |
= std::find (m_udp->m_sockets.begin (), m_udp->m_sockets.end (), this); |
196 |
if (it != m_udp->m_sockets.end ()) |
197 |
{ |
198 |
m_udp->m_sockets.erase (it); |
199 |
} |
200 |
} |
201 |
|
202 |
if (m_endPoint6 != 0) |
203 |
{ |
204 |
m_endPoint6->SetDestroyCallback (MakeNullCallback<void> ()); |
205 |
m_udp->DeAllocate (m_endPoint6); |
206 |
m_endPoint6 = 0; |
207 |
std::vector<Ptr<UdpSocketImpl> >::iterator it |
208 |
= std::find (m_udp->m_sockets.begin (), m_udp->m_sockets.end (), this); |
209 |
if (it != m_udp->m_sockets.end ()) |
210 |
{ |
211 |
m_udp->m_sockets.erase (it); |
212 |
} |
213 |
} |
214 |
} |
215 |
|
183 |
int |
216 |
int |
184 |
UdpSocketImpl::FinishBind (void) |
217 |
UdpSocketImpl::FinishBind (void) |
185 |
{ |
218 |
{ |
|
318 |
} |
351 |
} |
319 |
m_shutdownRecv = true; |
352 |
m_shutdownRecv = true; |
320 |
m_shutdownSend = true; |
353 |
m_shutdownSend = true; |
|
|
354 |
DeallocateEndPoint (); |
321 |
return 0; |
355 |
return 0; |
322 |
} |
356 |
} |
323 |
|
357 |
|