aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/server_epoll.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/net/server_epoll.lua b/net/server_epoll.lua
index 20c49daf..b3d24c7b 100644
--- a/net/server_epoll.lua
+++ b/net/server_epoll.lua
@@ -268,6 +268,12 @@ end
-- Called when socket is readable
function interface:onreadable()
local data, err, partial = self.conn:receive(self._pattern);
+ if self.conn:dirty() then
+ self:setreadtimeout(false);
+ self:pausefor(cfg.read_retry_delay);
+ else
+ self:setreadtimeout();
+ end
if data or partial then
self:on("incoming", data or partial, err);
end
@@ -280,12 +286,6 @@ function interface:onreadable()
self:destroy()
return;
end
- if self.conn:dirty() then
- self:setreadtimeout(false);
- self:pausefor(cfg.read_retry_delay);
- else
- self:setreadtimeout();
- end
end
-- Called when socket is writable