net/server_epoll.lua
changeset 10421 d8a0b0d21c81
parent 10420 6af8c812a885
child 10422 c8aa66595072
equal deleted inserted replaced
10420:6af8c812a885 10421:d8a0b0d21c81
   259 	if self._readtimeout then
   259 	if self._readtimeout then
   260 		self._readtimeout:reschedule(gettime() + t);
   260 		self._readtimeout:reschedule(gettime() + t);
   261 	else
   261 	else
   262 		self._readtimeout = addtimer(t, function ()
   262 		self._readtimeout = addtimer(t, function ()
   263 			if self:on("readtimeout") then
   263 			if self:on("readtimeout") then
   264 				self:debug("Read timeout, handled");
   264 				self:debug("Read timeout handled");
   265 				return cfg.read_timeout;
   265 				return cfg.read_timeout;
   266 			else
   266 			else
   267 				self:debug("Read timeout, fatal");
   267 				self:debug("Read timeout not handled, disconnecting");
   268 				self:on("disconnect", "read timeout");
   268 				self:on("disconnect", "read timeout");
   269 				self:destroy();
   269 				self:destroy();
   270 			end
   270 			end
   271 		end);
   271 		end);
   272 	end
   272 	end