aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/server_epoll.lua11
1 files changed, 6 insertions, 5 deletions
diff --git a/net/server_epoll.lua b/net/server_epoll.lua
index 21a6f785..427f470a 100644
--- a/net/server_epoll.lua
+++ b/net/server_epoll.lua
@@ -479,17 +479,18 @@ function interface:init()
self._tls = false; -- This means we should call onconnect when TLS is up
return self:starttls();
else
- self:setflags(false, true);
- self:setwritetimeout(cfg.connect_timeout);
+ self.onwriteable = interface.onconnect;
+ self:setwritetimeout();
+ return self:setflags(false, true);
end
end
function interface:pause()
- self:setflags(false);
+ return self:setflags(false);
end
function interface:resume()
- self:setflags(true);
+ return self:setflags(true);
end
-- Pause connection for some time
@@ -501,10 +502,10 @@ function interface:pausefor(t)
self:setflags(false);
self._pausefor = addtimer(t, function ()
self._pausefor = nil;
- self:setflags(true);
if self.conn:dirty() then
self:onreadable();
end
+ return self:setflags(true);
end);
end