Skip to content

Commit 175fb26

Browse files
committed
net: remove now unused Sock::Release()
1 parent 8e7eeb5 commit 175fb26

File tree

3 files changed

+0
-24
lines changed

3 files changed

+0
-24
lines changed

src/test/sock_tests.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,6 @@ BOOST_AUTO_TEST_CASE(move_assignment)
6969
BOOST_CHECK(SocketIsClosed(s));
7070
}
7171

72-
BOOST_AUTO_TEST_CASE(release)
73-
{
74-
SOCKET s = CreateSocket();
75-
Sock* sock = new Sock(s);
76-
BOOST_CHECK_EQUAL(sock->Release(), s);
77-
delete sock;
78-
BOOST_CHECK(!SocketIsClosed(s));
79-
BOOST_REQUIRE(CloseSocket(s));
80-
}
81-
8272
BOOST_AUTO_TEST_CASE(reset)
8373
{
8474
const SOCKET s = CreateSocket();

src/util/sock.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,6 @@ Sock& Sock::operator=(Sock&& other)
5151

5252
SOCKET Sock::Get() const { return m_socket; }
5353

54-
SOCKET Sock::Release()
55-
{
56-
const SOCKET s = m_socket;
57-
m_socket = INVALID_SOCKET;
58-
return s;
59-
}
60-
6154
void Sock::Reset() { CloseSocket(m_socket); }
6255

6356
ssize_t Sock::Send(const void* data, size_t len, int flags) const

src/util/sock.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,6 @@ class Sock
6868
*/
6969
[[nodiscard]] virtual SOCKET Get() const;
7070

71-
/**
72-
* Get the value of the contained socket and drop ownership. It will not be closed by the
73-
* destructor after this call.
74-
* @return socket or INVALID_SOCKET if empty
75-
*/
76-
virtual SOCKET Release();
77-
7871
/**
7972
* Close if non-empty.
8073
*/

0 commit comments

Comments
 (0)