service: bsd: Add keepalive socket option

This commit is contained in:
tech-ticks 2022-04-07 23:05:50 +02:00
parent de955ddc9d
commit cdc7fc731d
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);
}