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

@@ -49,12 +49,3 @@ socket_bind_listen(int domain, int type, int protocol,
return fd;
}
int
socket_keepalive(int fd)
{
const int reuse = 1;
return setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE,
(const char *)&reuse, sizeof(reuse));
}