net.server_epoll: Separate timeout for initial connection attempts
authorKim Alvefur <zash@zash.se>
Sat, 09 Feb 2019 20:34:00 +0100
changeset 9828 729de68f0068
parent 9827 b61ba4496923
child 9829 5ccce16c6449
net.server_epoll: Separate timeout for initial connection attempts server_event has this separation already
net/server_epoll.lua
--- a/net/server_epoll.lua	Sat Feb 09 19:36:35 2019 +0100
+++ b/net/server_epoll.lua	Sat Feb 09 20:34:00 2019 +0100
@@ -41,6 +41,9 @@
 	-- How long to wait for a socket to become writable after queuing data to send
 	send_timeout = 60;
 
+	-- How long to wait for a socket to become writable after creation
+	connect_timeout = 20;
+
 	-- Some number possibly influencing how many pending connections can be accepted
 	tcp_backlog = 128;
 
@@ -585,7 +588,7 @@
 
 -- Initialization
 function interface:init()
-	self:setwritetimeout();
+	self:setwritetimeout(cfg.connect_timeout);
 	return self:add(true, true);
 end