# HG changeset patch # User Kim Alvefur # Date 1625759864 -7200 # Node ID 68f0196ece2aac3add7642040aba5799a4612f2e # Parent 00295a8e5bcfa766cc179f8f7255cf1a27b671da net.server_epoll: Immediately attempt to read from newly accepted connections This may speed up client-first protocols (e.g. XMPP, HTTP and TLS) when the first client data already arrived by the time we accept() it. If LuaSocket supported TCP_DEFER_ACCEPT we could use that to further increase the chance that there's already data to handle. In case no data has arrived, no harm should be done, :onreadable would simply set the read timeout and we'll get back to it once there is something to handle. diff -r 00295a8e5bcf -r 68f0196ece2a net/server_epoll.lua --- a/net/server_epoll.lua Thu Jul 08 17:52:59 2021 +0200 +++ b/net/server_epoll.lua Thu Jul 08 17:57:44 2021 +0200 @@ -698,8 +698,8 @@ client:starttls(self.tls_ctx); else client:add(true, false); - client:setreadtimeout(); client:onconnect(); + client:onreadable(); end end