Changeset

8271:c09deab9989e

net.server_epoll: Add interface:server() method to match server_event (fixes c2s:show traceback in telnet console)
author Kim Alvefur <zash@zash.se>
date Fri, 29 Sep 2017 10:50:27 +0200
parents 8270:8b470cf497b7
children 8285:433b2a41351f
files net/server_epoll.lua
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/net/server_epoll.lua	Tue Sep 26 17:49:20 2017 +0100
+++ b/net/server_epoll.lua	Fri Sep 29 10:50:27 2017 +0200
@@ -167,6 +167,10 @@
 	return _SOCKETINVALID;
 end
 
+function interface:server()
+	return self._server or self;
+end
+
 -- Get IP address
 function interface:ip()
 	return self.peername or self.sockname;
@@ -186,8 +190,8 @@
 function interface:serverport()
 	if self.sockport then
 		return self.sockport;
-	elseif self.server then
-		self.server:port();
+	elseif self._server then
+		self._server:port();
 	end
 end
 
@@ -465,7 +469,7 @@
 	client:settimeout(0);
 	local conn = setmetatable({
 		conn = client;
-		server = server;
+		_server = server;
 		created = gettime();
 		listeners = listeners;
 		_pattern = pattern or (server and server._pattern);