Comparison

net/server_epoll.lua @ 10282:05ba04725a15

net.server_epoll: Add some timeout related logging
author Kim Alvefur <zash@zash.se>
date Sun, 29 Sep 2019 15:18:40 +0200
parent 10280:6b8b255f1d10
child 10283:dff360d00dfa
comparison
equal deleted inserted replaced
10281:f90abf142d53 10282:05ba04725a15
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 return cfg.read_timeout; 265 return cfg.read_timeout;
265 else 266 else
267 self:debug("Read timeout, fatal");
266 self:on("disconnect", "read timeout"); 268 self:on("disconnect", "read timeout");
267 self:destroy(); 269 self:destroy();
268 end 270 end
269 end); 271 end);
270 end 272 end
282 t = t or cfg.send_timeout; 284 t = t or cfg.send_timeout;
283 if self._writetimeout then 285 if self._writetimeout then
284 self._writetimeout:reschedule(gettime() + t); 286 self._writetimeout:reschedule(gettime() + t);
285 else 287 else
286 self._writetimeout = addtimer(t, function () 288 self._writetimeout = addtimer(t, function ()
289 self:debug("Write timeout");
287 self:on("disconnect", "write timeout"); 290 self:on("disconnect", "write timeout");
288 self:destroy(); 291 self:destroy();
289 end); 292 end);
290 end 293 end
291 end 294 end