Comparison

net/server_epoll.lua @ 9594:dcf466e04f81

net.server_epoll: Use method to update peername on connect
author Kim Alvefur <zash@zash.se>
date Mon, 29 Oct 2018 02:13:09 +0100
parent 9587:42eedef517dc
child 9666:270216874740
comparison
equal deleted inserted replaced
9587:42eedef517dc 9594:dcf466e04f81
610 end 610 end
611 end 611 end
612 612
613 -- Connected! 613 -- Connected!
614 function interface:onconnect() 614 function interface:onconnect()
615 if self.conn and not self.peername and self.conn.getpeername then 615 self:updatenames();
616 self.peername, self.peerport = self.conn:getpeername();
617 end
618 self.onconnect = noop; 616 self.onconnect = noop;
619 self:on("connect"); 617 self:on("connect");
620 end 618 end
621 619
622 local function addserver(addr, port, listeners, read_size, tls_ctx) 620 local function addserver(addr, port, listeners, read_size, tls_ctx)