diff options
author | Kim Alvefur <zash@zash.se> | 2021-07-14 22:13:30 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2021-07-14 22:13:30 +0200 |
commit | 15dd3e56878b2deb7918add604e0dcb33073dafb (patch) | |
tree | d53519fab105191069a6b22574091d49e47f8971 /net/server_epoll.lua | |
parent | f11bc3c99c73095c3ac7c8ac9ac92c9f6d43ab7d (diff) | |
download | prosody-15dd3e56878b2deb7918add604e0dcb33073dafb.tar.gz prosody-15dd3e56878b2deb7918add604e0dcb33073dafb.zip |
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.
Diffstat (limited to 'net/server_epoll.lua')
-rw-r--r-- | net/server_epoll.lua | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/server_epoll.lua b/net/server_epoll.lua index 0e615b19..4ffaf506 100644 --- a/net/server_epoll.lua +++ b/net/server_epoll.lua @@ -733,6 +733,9 @@ end 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 |