Changeset

7596:2c4ba55b616c

net.server_epoll: Connect async in addclient
author Kim Alvefur <zash@zash.se>
date Thu, 18 Aug 2016 17:04:57 +0200
parents 7595:166b2e0766a4
children 7597:cd34aa6b1632
files net/server_epoll.lua
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/net/server_epoll.lua	Thu Aug 18 16:48:16 2016 +0200
+++ b/net/server_epoll.lua	Thu Aug 18 17:04:57 2016 +0200
@@ -529,9 +529,10 @@
 end
 
 local function addclient(addr, port, listeners, pattern, tls)
-	local conn, err = socket.connect(addr, port);
+	local conn, err = socket.tcp();
 	if not conn then return conn, err; end
 	conn:settimeout(0);
+	conn:connect(addr, port);
 	local client = wrapclient(conn, addr, port, listeners, pattern, tls);
 	if tls then
 		client._tls = false;