Comparison

net/server_epoll.lua @ 10638:92918212ee83

net.server_epoll: Different error to distinguish connection timeout This mirrors what server_event does.
author Kim Alvefur <zash@zash.se>
date Sat, 01 Feb 2020 00:33:08 +0100
parent 10589:3540118699cf
child 10649:228277be4a28
comparison
equal deleted inserted replaced
10637:aa304109fa1b 10638:92918212ee83
297 if self._writetimeout then 297 if self._writetimeout then
298 self._writetimeout:reschedule(t); 298 self._writetimeout:reschedule(t);
299 else 299 else
300 self._writetimeout = addtimer(t, function () 300 self._writetimeout = addtimer(t, function ()
301 self:noise("Write timeout"); 301 self:noise("Write timeout");
302 self:on("disconnect", "write timeout"); 302 self:on("disconnect", self._connected and "write timeout" or "connection timeout");
303 self:destroy(); 303 self:destroy();
304 end); 304 end);
305 end 305 end
306 end 306 end
307 307
709 end 709 end
710 end 710 end
711 711
712 -- Connected! 712 -- Connected!
713 function interface:onconnect() 713 function interface:onconnect()
714 self._connected = true;
714 self:updatenames(); 715 self:updatenames();
715 self:debug("Connected (%s)", self); 716 self:debug("Connected (%s)", self);
716 self.onconnect = noop; 717 self.onconnect = noop;
717 self:on("connect"); 718 self:on("connect");
718 end 719 end