Implement UdpSocketImpl::Close ()

This commit is contained in:
Tom Henderson
2009-08-05 20:53:44 -07:00
parent 2228a32b8f
commit 7d21df488f
2 changed files with 9 additions and 1 deletions

View File

@@ -203,9 +203,16 @@ UdpSocketImpl::ShutdownRecv (void)
}
int
UdpSocketImpl::Close(void)
UdpSocketImpl::Close (void)
{
NS_LOG_FUNCTION_NOARGS ();
if (m_shutdownRecv == true && m_shutdownSend == true)
{
m_errno = Socket::ERROR_BADF;
return -1;
}
m_shutdownRecv = true;
m_shutdownSend = true;
return 0;
}

View File

@@ -184,6 +184,7 @@ public:
/**
* \brief Close a socket.
* \returns zero on success, -1 on failure.
*
* After the Close call, the socket is no longer valid, and cannot
* safely be used for subsequent operations.