Software /
code /
prosody
Comparison
net/server_epoll.lua @ 9321:146dc1e4c7ff
net.server_epoll: Simplify minimal string representation
.conn might just be the FD sometimes
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 15 Sep 2018 14:27:38 +0200 |
parent | 9320:8cc498cb0df7 |
child | 9381:80be543a3785 |
comparison
equal
deleted
inserted
replaced
9320:8cc498cb0df7 | 9321:146dc1e4c7ff |
---|---|
130 if self.sockname and self.peername then | 130 if self.sockname and self.peername then |
131 return ("FD %d (%s, %d, %s, %d)"):format(self:getfd(), self.peername, self.peerport, self.sockname, self.sockport); | 131 return ("FD %d (%s, %d, %s, %d)"):format(self:getfd(), self.peername, self.peerport, self.sockname, self.sockport); |
132 elseif self.sockname or self.peername then | 132 elseif self.sockname or self.peername then |
133 return ("FD %d (%s, %d)"):format(self:getfd(), self.sockname or self.peername, self.sockport or self.peerport); | 133 return ("FD %d (%s, %d)"):format(self:getfd(), self.sockname or self.peername, self.sockport or self.peerport); |
134 end | 134 end |
135 return ("%s FD %d"):format(tostring(self.conn), self:getfd()); | 135 return ("FD %d"):format(self:getfd()); |
136 end | 136 end |
137 | 137 |
138 -- Replace the listener and tell the old one | 138 -- Replace the listener and tell the old one |
139 function interface:setlistener(listeners) | 139 function interface:setlistener(listeners) |
140 self:on("detach"); | 140 self:on("detach"); |