Socket: Move shutdown from SocketProtocol::close() to INetSocketProtocol::close()
g0dil [Thu, 26 Feb 2009 12:48:57 +0000 (12:48 +0000)]
git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1135 270642c3-0616-0410-b53a-bc976706d245

Socket/Protocols/INet/TCPSocketProtocol.cc
Socket/Protocols/INet/TCPSocketProtocol.hh
Socket/SocketProtocol.cc

index 781b5e6..5f49a44 100644 (file)
@@ -79,7 +79,14 @@ prefix_ void senf::TCPSocketProtocol::shutdown(ShutType type)
     const
 {
     if (::shutdown(fd(), type) < 0)
-        SENF_THROW_SYSTEM_EXCEPTION("");
+        SENF_THROW_SYSTEM_EXCEPTION("::shutdown()");
+}
+
+prefix_ void senf::TCPSocketProtocol::close()
+    const
+{
+    shutdown(ShutRDWR);
+    INetSocketProtocol::close();
 }
 
 prefix_ unsigned senf::TCPSocketProtocol::available()
index d11578c..91021a0 100644 (file)
@@ -66,6 +66,7 @@ namespace senf {
         ///\name Abstract Interface Implementation
         ///@{
 
+        void close() const;
         unsigned available() const;
         bool eof() const;
 
index 67ed340..5e15222 100644 (file)
@@ -37,8 +37,6 @@
 prefix_ void senf::SocketProtocol::close()
     const
 {
-    if (::shutdown(body().fd(),SHUT_RDWR) < 0)
-        SENF_THROW_SYSTEM_EXCEPTION("::shutdown(socket_fd)");
     if (::close(body().fd()) < 0)
         SENF_THROW_SYSTEM_EXCEPTION("::close(socket_fd)");
 }