|
812 |
void |
812 |
void |
813 |
TcpSocketBase::CloseAndNotify (void) |
813 |
TcpSocketBase::CloseAndNotify (void) |
814 |
{ |
814 |
{ |
815 |
Ptr<TcpSocketBase> l_ptr = (m_state == TIME_WAIT ? this : 0); |
|
|
816 |
|
817 |
NS_LOG_FUNCTION (this); |
815 |
NS_LOG_FUNCTION (this); |
818 |
|
816 |
|
819 |
if (!m_closeNotified) |
817 |
if (!m_closeNotified) |
820 |
{ |
818 |
{ |
821 |
NotifyNormalClose (); |
819 |
NotifyNormalClose (); |
|
|
820 |
m_closeNotified = true; |
822 |
} |
821 |
} |
823 |
|
822 |
|
|
|
823 |
NS_LOG_INFO (TcpStateName[m_state] << " -> CLOSED"); |
824 |
m_state = CLOSED; |
824 |
DeallocateEndPoint (); |
825 |
DeallocateEndPoint (); |
825 |
m_closeNotified = true; |
|
|
826 |
NS_LOG_INFO (TcpStateName[m_state] << " -> CLOSED"); |
827 |
CancelAllTimers (); |
828 |
m_state = CLOSED; |
829 |
} |
826 |
} |
830 |
|
827 |
|
831 |
|
828 |
|
|
1749 |
{ |
1746 |
{ |
1750 |
if (m_endPoint != 0) |
1747 |
if (m_endPoint != 0) |
1751 |
{ |
1748 |
{ |
|
|
1749 |
CancelAllTimers (); |
1752 |
m_endPoint->SetDestroyCallback (MakeNullCallback<void> ()); |
1750 |
m_endPoint->SetDestroyCallback (MakeNullCallback<void> ()); |
1753 |
m_tcp->DeAllocate (m_endPoint); |
1751 |
m_tcp->DeAllocate (m_endPoint); |
1754 |
m_endPoint = 0; |
1752 |
m_endPoint = 0; |
|
1758 |
{ |
1756 |
{ |
1759 |
m_tcp->m_sockets.erase (it); |
1757 |
m_tcp->m_sockets.erase (it); |
1760 |
} |
1758 |
} |
|
|
1759 |
} |
1760 |
else if (m_endPoint6 != 0) |
1761 |
{ |
1761 |
CancelAllTimers (); |
1762 |
CancelAllTimers (); |
1762 |
} |
|
|
1763 |
if (m_endPoint6 != 0) |
1764 |
{ |
1765 |
m_endPoint6->SetDestroyCallback (MakeNullCallback<void> ()); |
1763 |
m_endPoint6->SetDestroyCallback (MakeNullCallback<void> ()); |
1766 |
m_tcp->DeAllocate (m_endPoint6); |
1764 |
m_tcp->DeAllocate (m_endPoint6); |
1767 |
m_endPoint6 = 0; |
1765 |
m_endPoint6 = 0; |
|
1771 |
{ |
1769 |
{ |
1772 |
m_tcp->m_sockets.erase (it); |
1770 |
m_tcp->m_sockets.erase (it); |
1773 |
} |
1771 |
} |
1774 |
CancelAllTimers (); |
|
|
1775 |
} |
1772 |
} |
1776 |
} |
1773 |
} |
1777 |
|
1774 |
|