Skip to content

Commit 4717e3b

Browse files
committed
net/SocketDescriptor: add Duplicate() method
The the Duplicate() method we inherited from class FileDescriptor returns a UniqueFileDescriptor, but we really want to return a UniqueSocketDescriptor.
1 parent 9e5adca commit 4717e3b

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/net/SocketDescriptor.hxx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class SocketAddress;
2424
class StaticSocketAddress;
2525
class IPv4Address;
2626
class IPv6Address;
27+
class UniqueSocketDescriptor;
2728

2829
/**
2930
* An OO wrapper for a Berkeley or WinSock socket descriptor.
@@ -137,7 +138,10 @@ public:
137138

138139
using FileDescriptor::SetNonBlocking;
139140
using FileDescriptor::SetBlocking;
140-
using FileDescriptor::Duplicate;
141+
142+
[[nodiscard]]
143+
UniqueSocketDescriptor Duplicate() const noexcept;
144+
141145
using FileDescriptor::CheckDuplicate;
142146
using FileDescriptor::Close;
143147
#else

src/net/meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
net_dep = declare_dependency(
22
dependencies: [
33
system_dep,
4+
io_dep,
45
],
56
)

0 commit comments

Comments
 (0)