Comparison

net/server_epoll.lua @ 7599:afbda0bd9cfc

net.server_epoll: Add separate timout for initial connection
author Kim Alvefur <zash@zash.se>
date Thu, 18 Aug 2016 17:13:22 +0200
parent 7598:335b5ce06062
child 7600:a18532076efe
comparison
equal deleted inserted replaced
7598:335b5ce06062 7599:afbda0bd9cfc
28 read_timeout = 900; 28 read_timeout = 900;
29 write_timeout = 7; 29 write_timeout = 7;
30 tcp_backlog = 128; 30 tcp_backlog = 128;
31 accept_retry_interval = 10; 31 accept_retry_interval = 10;
32 read_retry_delay = 1e-06; 32 read_retry_delay = 1e-06;
33 connect_timeout = 20;
33 handshake_timeout = 60; 34 handshake_timeout = 60;
34 }; 35 };
35 36
36 local fds = createtable(10, 0); -- FD -> conn 37 local fds = createtable(10, 0); -- FD -> conn
37 local timers = {}; 38 local timers = {};
462 if self.tls and not self._tls then 463 if self.tls and not self._tls then
463 self._tls = false; -- This means we should call onconnect when TLS is up 464 self._tls = false; -- This means we should call onconnect when TLS is up
464 return self:starttls(); 465 return self:starttls();
465 else 466 else
466 self:setflags(false, true); 467 self:setflags(false, true);
467 end 468 self:setwritetimeout(cfg.connect_timeout);
468 self:setreadtimeout(); 469 end
469 end 470 end
470 471
471 function interface:pause() 472 function interface:pause()
472 self:setflags(false); 473 self:setflags(false);
473 end 474 end