Skip to content

Commit

Permalink
net/SocketDescriptor: add Duplicate() method
Browse files Browse the repository at this point in the history
The the Duplicate() method we inherited from class FileDescriptor
returns a UniqueFileDescriptor, but we really want to return a
UniqueSocketDescriptor.
  • Loading branch information
MaxKellermann committed Sep 27, 2024
1 parent 9e5adca commit 4717e3b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/net/SocketDescriptor.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class SocketAddress;
class StaticSocketAddress;
class IPv4Address;
class IPv6Address;
class UniqueSocketDescriptor;

/**
* An OO wrapper for a Berkeley or WinSock socket descriptor.
Expand Down Expand Up @@ -137,7 +138,10 @@ public:

using FileDescriptor::SetNonBlocking;
using FileDescriptor::SetBlocking;
using FileDescriptor::Duplicate;

[[nodiscard]]
UniqueSocketDescriptor Duplicate() const noexcept;

using FileDescriptor::CheckDuplicate;
using FileDescriptor::Close;
#else
Expand Down
1 change: 1 addition & 0 deletions src/net/meson.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
net_dep = declare_dependency(
dependencies: [
system_dep,
io_dep,
],
)

0 comments on commit 4717e3b

Please sign in to comment.