# HG changeset patch # User Kim Alvefur # Date 1626293610 -7200 # Node ID 3fc564f7441beed827710a2649748e377e06bc93 # Parent 153d2fdd97d3a52aee33c99b637fa3e45561b7b0 net.server_epoll: Support setting keepalive idle time Activated by setting config.tcp_keepalive to a number, in seconds. Defaults to 2h. Depends on LuaSocket support for this option. diff -r 153d2fdd97d3 -r 3fc564f7441b net/server_epoll.lua --- a/net/server_epoll.lua Wed Jul 14 22:09:39 2021 +0200 +++ b/net/server_epoll.lua Wed Jul 14 22:13:30 2021 +0200 @@ -733,6 +733,9 @@ function interface:defaultoptions() if cfg.tcp_keepalive then self:setoption("keepalive", true); + if type(cfg.tcp_keepalive) == "number" then + self:setoption("tcp-keepidle", cfg.tcp_keepalive); + end end end