diff --git a/src/event/ServerSocket.cxx b/src/event/ServerSocket.cxx index d3abb124a..cf51cb363 100644 --- a/src/event/ServerSocket.cxx +++ b/src/event/ServerSocket.cxx @@ -288,6 +288,18 @@ ServerSocket::AddFD(UniqueSocketDescriptor fd) s.SetFD(std::move(fd)); } +void +ServerSocket::AddFD(UniqueSocketDescriptor fd, + AllocatedSocketAddress &&address) noexcept +{ + assert(fd.IsDefined()); + assert(!address.IsNull()); + assert(address.IsDefined()); + + OneServerSocket &s = AddAddress(std::move(address)); + s.SetFD(std::move(fd)); +} + #ifdef HAVE_TCP inline void diff --git a/src/event/ServerSocket.hxx b/src/event/ServerSocket.hxx index 3cb0ad422..5b0d81cdd 100644 --- a/src/event/ServerSocket.hxx +++ b/src/event/ServerSocket.hxx @@ -108,6 +108,9 @@ public: */ void AddFD(UniqueSocketDescriptor fd); + void AddFD(UniqueSocketDescriptor fd, + AllocatedSocketAddress &&address) noexcept; + bool IsEmpty() const noexcept { return sockets.empty(); }