Diff

net/server_epoll.lua @ 8777:2bfe963f3041

net.server_epoll: Retry retrieving peername once connected
author Kim Alvefur <zash@zash.se>
date Wed, 02 May 2018 19:20:57 +0200
parent 8776:e7d4344e0fea
child 8778:0364454bdd77
line wrap: on
line diff
--- a/net/server_epoll.lua	Wed May 02 19:20:29 2018 +0200
+++ b/net/server_epoll.lua	Wed May 02 19:20:57 2018 +0200
@@ -540,6 +540,9 @@
 
 -- Connected!
 function interface:onconnect()
+	if self.conn and not self.peername then
+		self.peername, self.peerport = self.conn:getpeername();
+	end
 	self.onconnect = noop;
 	self:on("connect");
 end