servers: set CLOEXEC on sockets we accept
This commit is contained in:
parent
9eee6058a7
commit
d228f6ac29
1 changed files with 1 additions and 0 deletions
|
@ -134,6 +134,7 @@ void server_base::serve(boost::asio::yield_context yield, boost::asio::ip::tcp::
|
|||
setsockopt(socket->native_handle(), SOL_TCP, TCP_KEEPIDLE, &timeout, sizeof(timeout));
|
||||
setsockopt(socket->native_handle(), SOL_TCP, TCP_KEEPCNT, &cnt, sizeof(cnt));
|
||||
setsockopt(socket->native_handle(), SOL_TCP, TCP_KEEPINTVL, &interval, sizeof(interval));
|
||||
fcntl(socket->native_handle(), F_SETFD, FD_CLOEXEC);
|
||||
#endif
|
||||
#if defined(__APPLE__) && defined(__MACH__)
|
||||
setsockopt(socket->native_handle(), IPPROTO_TCP, TCP_KEEPALIVE, &timeout, sizeof(timeout));
|
||||
|
|
Loading…
Add table
Reference in a new issue