event/SocketEvent: rename Steal() to ReleaseSocket()

This commit is contained in:
Max Kellermann
2020-10-15 16:52:36 +02:00
parent 95bb12880d
commit ff6e434caf
4 changed files with 11 additions and 23 deletions
-10
View File
@@ -37,16 +37,6 @@ SocketEvent::Open(SocketDescriptor _fd) noexcept
fd = _fd;
}
SocketDescriptor
SocketEvent::Steal() noexcept
{
assert(IsDefined());
Cancel();
return std::exchange(fd, SocketDescriptor::Undefined());
}
void
SocketEvent::Close() noexcept
{
+5 -6
View File
@@ -109,13 +109,12 @@ public:
return fd;
}
void Open(SocketDescriptor _fd) noexcept;
SocketDescriptor ReleaseSocket() noexcept {
Cancel();
return std::exchange(fd, SocketDescriptor::Undefined());
}
/**
* "Steal" the socket descriptor. This abandons the socket
* and returns it.
*/
SocketDescriptor Steal() noexcept;
void Open(SocketDescriptor _fd) noexcept;
void Close() noexcept;