event/ServerSocket: add AddFD() overload with AllocatedSocketAddress&&
This commit is contained in:
parent
ce9f09c69a
commit
a943f4063c
@ -288,6 +288,18 @@ ServerSocket::AddFD(UniqueSocketDescriptor fd)
|
|||||||
s.SetFD(std::move(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
|
#ifdef HAVE_TCP
|
||||||
|
|
||||||
inline void
|
inline void
|
||||||
|
@ -108,6 +108,9 @@ public:
|
|||||||
*/
|
*/
|
||||||
void AddFD(UniqueSocketDescriptor fd);
|
void AddFD(UniqueSocketDescriptor fd);
|
||||||
|
|
||||||
|
void AddFD(UniqueSocketDescriptor fd,
|
||||||
|
AllocatedSocketAddress &&address) noexcept;
|
||||||
|
|
||||||
bool IsEmpty() const noexcept {
|
bool IsEmpty() const noexcept {
|
||||||
return sockets.empty();
|
return sockets.empty();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user