Changeset

10638:92918212ee83

net.server_epoll: Different error to distinguish connection timeout This mirrors what server_event does.
author Kim Alvefur <zash@zash.se>
date Sat, 01 Feb 2020 00:33:08 +0100
parents 10637:aa304109fa1b
children 10639:08e3063eb1ac
files net/server_epoll.lua
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/net/server_epoll.lua	Thu Jan 30 14:22:21 2020 +0100
+++ b/net/server_epoll.lua	Sat Feb 01 00:33:08 2020 +0100
@@ -299,7 +299,7 @@
 	else
 		self._writetimeout = addtimer(t, function ()
 			self:noise("Write timeout");
-			self:on("disconnect", "write timeout");
+			self:on("disconnect", self._connected and "write timeout" or "connection timeout");
 			self:destroy();
 		end);
 	end
@@ -711,6 +711,7 @@
 
 -- Connected!
 function interface:onconnect()
+	self._connected = true;
 	self:updatenames();
 	self:debug("Connected (%s)", self);
 	self.onconnect = noop;