Comparison

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
comparison
equal deleted inserted replaced
11687:153d2fdd97d3 11688:3fc564f7441b
731 end 731 end
732 732
733 function interface:defaultoptions() 733 function interface:defaultoptions()
734 if cfg.tcp_keepalive then 734 if cfg.tcp_keepalive then
735 self:setoption("keepalive", true); 735 self:setoption("keepalive", true);
736 if type(cfg.tcp_keepalive) == "number" then
737 self:setoption("tcp-keepidle", cfg.tcp_keepalive);
738 end
736 end 739 end
737 end 740 end
738 741
739 function interface:pause() 742 function interface:pause()
740 self:noise("Pause reading"); 743 self:noise("Pause reading");