diff options
author | Vasil Dimov <vd@FreeBSD.org> | 2021-04-29 17:39:02 +0200 |
---|---|---|
committer | Vasil Dimov <vd@FreeBSD.org> | 2022-06-20 15:01:28 +0200 |
commit | 175fb2670a2a24220afb3eea99b7b65b0aa89c76 (patch) | |
tree | da85efd385e80941b9b42ff36b93bad74b922f01 /src | |
parent | 8e7eeb5971444c0c93e9a89bbdcc3a51a19e09e9 (diff) | |
download | bitcoin-175fb2670a2a24220afb3eea99b7b65b0aa89c76.tar.xz |
net: remove now unused Sock::Release()
Diffstat (limited to 'src')
-rw-r--r-- | src/test/sock_tests.cpp | 10 | ||||
-rw-r--r-- | src/util/sock.cpp | 7 | ||||
-rw-r--r-- | src/util/sock.h | 7 |
3 files changed, 0 insertions, 24 deletions
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 @@ -69,13 +69,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. */ virtual void Reset(); |