# HG changeset patch # User Kim Alvefur # Date 1506675027 -7200 # Node ID c09deab9989efecf726f02824a87b08b2d46c588 # Parent 8b470cf497b72d3bad9bba3418070f26d1acbfb7 net.server_epoll: Add interface:server() method to match server_event (fixes c2s:show traceback in telnet console) diff -r 8b470cf497b7 -r c09deab9989e net/server_epoll.lua --- 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);