--- a/src/internet-stack/udp-socket-impl.cc Thu Aug 06 10:23:12 2009 +0400
+++ b/src/internet-stack/udp-socket-impl.cc Wed Aug 05 20:53:44 2009 -0700
@@ -203,9 +203,16 @@
}
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;
}
--- a/src/node/socket.h Thu Aug 06 10:23:12 2009 +0400
+++ b/src/node/socket.h Wed Aug 05 20:53:44 2009 -0700
@@ -184,6 +184,7 @@
/**
* \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.