net/SocketDescriptor: add method SetKeepAlive()

This commit is contained in:
Max Kellermann
2017-08-10 19:25:02 +02:00
parent 9a5bcc6db0
commit 1f47dc990d
5 changed files with 8 additions and 13 deletions

View File

@@ -206,6 +206,12 @@ SocketDescriptor::SetOption(int level, int name,
return setsockopt(fd, level, name, (const char *)value, size) == 0;
}
bool
SocketDescriptor::SetKeepAlive(bool value)
{
return SetBoolOption(SOL_SOCKET, SO_KEEPALIVE, value);
}
bool
SocketDescriptor::SetReuseAddress(bool value)
{