From: g0dil Date: Tue, 3 Mar 2009 16:05:53 +0000 (+0000) Subject: Socket: Make SocketProtocol::close() non-const (at least all other virtuals need... X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=a6069ae6d8b265abc2f156d1ea0e12adca3771d5;p=senf.git Socket: Make SocketProtocol::close() non-const (at least all other virtuals need to follow) git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1141 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/Socket/Protocols/INet/TCPSocketProtocol.cc b/Socket/Protocols/INet/TCPSocketProtocol.cc index 5f49a44..3c88242 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 91021a0..cca471e 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 85266bd..9a4075c 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 fc56f1b..83bd3d1 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 5e15222..3a1fac5 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 7590312..b41fccb 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 497cff1..d03e6df 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); }