net/server_epoll.lua
changeset 10642 92918212ee83
parent 10593 3540118699cf
child 10653 228277be4a28
--- 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;