Comparison

net/server_epoll.lua @ 9821:7712488c8e49 0.11

net.server_epoll: Use send_timeout for write timout like other implementations (fixes #1316)
author Kim Alvefur <zash@zash.se>
date Thu, 07 Feb 2019 14:02:15 +0100
parent 9665:4790d1b88919
child 9822:13c2707d2417
comparison
equal deleted inserted replaced
9819:11671a2e07a9 9821:7712488c8e49
37 local default_config = { __index = { 37 local default_config = { __index = {
38 -- If a connection is silent for this long, close it unless onreadtimeout says not to 38 -- If a connection is silent for this long, close it unless onreadtimeout says not to
39 read_timeout = 14 * 60; 39 read_timeout = 14 * 60;
40 40
41 -- How long to wait for a socket to become writable after queuing data to send 41 -- How long to wait for a socket to become writable after queuing data to send
42 write_timeout = 60; 42 send_timeout = 60;
43 43
44 -- Some number possibly influencing how many pending connections can be accepted 44 -- Some number possibly influencing how many pending connections can be accepted
45 tcp_backlog = 128; 45 tcp_backlog = 128;
46 46
47 -- If accepting a new incoming connection fails, wait this long before trying again 47 -- If accepting a new incoming connection fails, wait this long before trying again
264 self._writetimeout:close(); 264 self._writetimeout:close();
265 self._writetimeout = nil; 265 self._writetimeout = nil;
266 end 266 end
267 return 267 return
268 end 268 end
269 t = t or cfg.write_timeout; 269 t = t or cfg.send_timeout;
270 if self._writetimeout then 270 if self._writetimeout then
271 self._writetimeout[1] = gettime() + t; 271 self._writetimeout[1] = gettime() + t;
272 resort_timers = true; 272 resort_timers = true;
273 else 273 else
274 self._writetimeout = addtimer(t, function () 274 self._writetimeout = addtimer(t, function ()