diff --git a/src/net/UniqueSocketDescriptor.hxx b/src/net/UniqueSocketDescriptor.hxx index 159f8022..4c4a6466 100644 --- a/src/net/UniqueSocketDescriptor.hxx +++ b/src/net/UniqueSocketDescriptor.hxx @@ -5,6 +5,10 @@ #include "SocketDescriptor.hxx" +#ifndef _WIN32 +#include "io/UniqueFileDescriptor.hxx" +#endif + #include class StaticSocketAddress; @@ -47,6 +51,12 @@ public: return std::exchange(*(SocketDescriptor *)this, Undefined()); } +#ifndef _WIN32 + UniqueFileDescriptor MoveToFileDescriptor() && noexcept { + return UniqueFileDescriptor{Release().ToFileDescriptor()}; + } +#endif + UniqueSocketDescriptor &operator=(UniqueSocketDescriptor &&src) noexcept { using std::swap; swap(fd, src.fd);