Diff

net/server_epoll.lua @ 11688:3fc564f7441b

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.
author Kim Alvefur <zash@zash.se>
date Wed, 14 Jul 2021 22:13:30 +0200
parent 11687:153d2fdd97d3
child 11689:f9f6e82fb572
line wrap: on
line diff
--- 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