service: bsd: Add keepalive socket option

This commit is contained in:
tech-ticks 2022-04-07 23:05:50 +02:00
parent f05e87402a
commit 1c3983c12e
4 changed files with 10 additions and 0 deletions

View file

@ -600,6 +600,10 @@ Errno Socket::SetReuseAddr(bool enable) {
return SetSockOpt<u32>(fd, SO_REUSEADDR, enable ? 1 : 0);
}
Errno Socket::SetKeepAlive(bool enable) {
return SetSockOpt<u32>(fd, SO_KEEPALIVE, enable ? 1 : 0);
}
Errno Socket::SetBroadcast(bool enable) {
return SetSockOpt<u32>(fd, SO_BROADCAST, enable ? 1 : 0);
}

View file

@ -67,6 +67,8 @@ public:
Errno SetReuseAddr(bool enable);
Errno SetKeepAlive(bool enable);
Errno SetBroadcast(bool enable);
Errno SetSndBuf(u32 value);