From 175fb2670a2a24220afb3eea99b7b65b0aa89c76 Mon Sep 17 00:00:00 2001 From: Vasil Dimov Date: Thu, 29 Apr 2021 17:39:02 +0200 Subject: net: remove now unused Sock::Release() --- src/test/sock_tests.cpp | 10 ---------- src/util/sock.cpp | 7 ------- src/util/sock.h | 7 ------- 3 files changed, 24 deletions(-) (limited to 'src') diff --git a/src/test/sock_tests.cpp b/src/test/sock_tests.cpp index 9e98f4f0b1..4a5b25c61b 100644 --- a/src/test/sock_tests.cpp +++ b/src/test/sock_tests.cpp @@ -69,16 +69,6 @@ BOOST_AUTO_TEST_CASE(move_assignment) BOOST_CHECK(SocketIsClosed(s)); } -BOOST_AUTO_TEST_CASE(release) -{ - SOCKET s = CreateSocket(); - Sock* sock = new Sock(s); - BOOST_CHECK_EQUAL(sock->Release(), s); - delete sock; - BOOST_CHECK(!SocketIsClosed(s)); - BOOST_REQUIRE(CloseSocket(s)); -} - BOOST_AUTO_TEST_CASE(reset) { const SOCKET s = CreateSocket(); diff --git a/src/util/sock.cpp b/src/util/sock.cpp index 7d5069423a..20418a940c 100644 --- a/src/util/sock.cpp +++ b/src/util/sock.cpp @@ -51,13 +51,6 @@ Sock& Sock::operator=(Sock&& other) SOCKET Sock::Get() const { return m_socket; } -SOCKET Sock::Release() -{ - const SOCKET s = m_socket; - m_socket = INVALID_SOCKET; - return s; -} - void Sock::Reset() { CloseSocket(m_socket); } ssize_t Sock::Send(const void* data, size_t len, int flags) const diff --git a/src/util/sock.h b/src/util/sock.h index 3245820995..2b041dbf3c 100644 --- a/src/util/sock.h +++ b/src/util/sock.h @@ -68,13 +68,6 @@ public: */ [[nodiscard]] virtual SOCKET Get() const; - /** - * Get the value of the contained socket and drop ownership. It will not be closed by the - * destructor after this call. - * @return socket or INVALID_SOCKET if empty - */ - virtual SOCKET Release(); - /** * Close if non-empty. */ -- cgit v1.2.3