From eac0711b8972ae5e2046b78670dd69287516003e Mon Sep 17 00:00:00 2001
From: g0dil <g0dil@wiback.org>
Date: Tue, 3 Mar 2009 16:05:53 +0000
Subject: [PATCH] Socket: Make SocketProtocol::close() non-const (at least all
 other virtuals need to follow)

---
 Socket/Protocols/INet/TCPSocketProtocol.cc | 1 -
 Socket/Protocols/INet/TCPSocketProtocol.hh | 2 +-
 Socket/Protocols/UN/UNSocketProtocol.cc    | 1 -
 Socket/Protocols/UN/UNSocketProtocol.hh    | 8 ++++----
 Socket/SocketProtocol.cc                   | 1 -
 Socket/SocketProtocol.hh                   | 2 +-
 Socket/SocketProtocol.test.hh              | 2 +-
 7 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/Socket/Protocols/INet/TCPSocketProtocol.cc b/Socket/Protocols/INet/TCPSocketProtocol.cc
index 5f49a4498..3c88242d6 100644
--- a/Socket/Protocols/INet/TCPSocketProtocol.cc
+++ b/Socket/Protocols/INet/TCPSocketProtocol.cc
@@ -83,7 +83,6 @@ prefix_ void senf::TCPSocketProtocol::shutdown(ShutType type)
 }
 
 prefix_ void senf::TCPSocketProtocol::close()
-    const
 {
     shutdown(ShutRDWR);
     INetSocketProtocol::close();
diff --git a/Socket/Protocols/INet/TCPSocketProtocol.hh b/Socket/Protocols/INet/TCPSocketProtocol.hh
index 91021a02f..cca471ea7 100644
--- a/Socket/Protocols/INet/TCPSocketProtocol.hh
+++ b/Socket/Protocols/INet/TCPSocketProtocol.hh
@@ -66,7 +66,7 @@ namespace senf {
         ///\name Abstract Interface Implementation
         ///@{
 
-        void close() const;
+        void close();
         unsigned available() const;
         bool eof() const;
 
diff --git a/Socket/Protocols/UN/UNSocketProtocol.cc b/Socket/Protocols/UN/UNSocketProtocol.cc
index 85266bdcd..9a4075cac 100644
--- a/Socket/Protocols/UN/UNSocketProtocol.cc
+++ b/Socket/Protocols/UN/UNSocketProtocol.cc
@@ -53,7 +53,6 @@ prefix_ bool senf::UNSocketProtocol::eof()
 }
 
 prefix_ void senf::UNSocketProtocol::close() 
-    const
 {
     check_and_unlink();
   
diff --git a/Socket/Protocols/UN/UNSocketProtocol.hh b/Socket/Protocols/UN/UNSocketProtocol.hh
index fc56f1be9..83bd3d108 100644
--- a/Socket/Protocols/UN/UNSocketProtocol.hh
+++ b/Socket/Protocols/UN/UNSocketProtocol.hh
@@ -49,10 +49,10 @@ namespace senf {
         : public virtual SocketProtocol
     {
     public:
-        virtual void close() const;   ///< Close socket
-                              /**< This override will automatically \c shutdown() the
-                                   socket whenever it is closed.
-                                   \throws senf::SystemException */  
+        virtual void close();           ///< Close socket
+                                        /**< This override will automatically \c shutdown() the
+                                             socket whenever it is closed.
+                                             \throws senf::SystemException */ // 
         virtual void terminate() const;       ///< Forcibly close socket
                                         /**< This override will automatically \c shutdown() the
                                            socket whenever it is called. Additionally it will
diff --git a/Socket/SocketProtocol.cc b/Socket/SocketProtocol.cc
index 5e15222aa..3a1fac50a 100644
--- a/Socket/SocketProtocol.cc
+++ b/Socket/SocketProtocol.cc
@@ -35,7 +35,6 @@
 ///////////////////////////////cc.p////////////////////////////////////////
 
 prefix_ void senf::SocketProtocol::close()
-    const
 {
     if (::close(body().fd()) < 0)
         SENF_THROW_SYSTEM_EXCEPTION("::close(socket_fd)");
diff --git a/Socket/SocketProtocol.hh b/Socket/SocketProtocol.hh
index 759031283..b41fccb8b 100644
--- a/Socket/SocketProtocol.hh
+++ b/Socket/SocketProtocol.hh
@@ -168,7 +168,7 @@ namespace senf {
                                              not support the notion of EOF, this member should
                                              always return \c false. */
 
-        virtual void close() const;     ///< Close socket
+        virtual void close();           ///< Close socket
                                         /**< This override will automatically \c shutdown() the
                                              socket whenever it is closed.
                                              \throws senf::SystemException 
diff --git a/Socket/SocketProtocol.test.hh b/Socket/SocketProtocol.test.hh
index 497cff16f..d03e6df92 100644
--- a/Socket/SocketProtocol.test.hh
+++ b/Socket/SocketProtocol.test.hh
@@ -48,7 +48,7 @@ namespace test {
         bool eof() const
             { return false; }
 
-        virtual void close() const {
+        virtual void close() {
             closeCount(1);
         }
 
-- 
GitLab