aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/server_epoll.lua2
-rw-r--r--net/server_event.lua2
-rw-r--r--net/server_select.lua2
3 files changed, 3 insertions, 3 deletions
diff --git a/net/server_epoll.lua b/net/server_epoll.lua
index fb13070b..e0189179 100644
--- a/net/server_epoll.lua
+++ b/net/server_epoll.lua
@@ -645,7 +645,7 @@ local function addclient(addr, port, listeners, read_size, tls_ctx, typ)
local conn, err = create();
local ok, err = conn:settimeout(0);
if not ok then return ok, err; end
- local ok, err = conn:connect(addr, port);
+ local ok, err = conn:setpeername(addr, port);
if not ok and err ~= "timeout" then return ok, err; end
local client = wrapsocket(conn, nil, read_size, listeners, tls_ctx)
local ok, err = client:init();
diff --git a/net/server_event.lua b/net/server_event.lua
index ff3f921b..11bd6a29 100644
--- a/net/server_event.lua
+++ b/net/server_event.lua
@@ -747,7 +747,7 @@ local function addclient( addr, serverport, listener, pattern, sslctx, typ )
return nil, err
end
client:settimeout( 0 ) -- set nonblocking
- local res, err = client:connect( addr, serverport ) -- connect
+ local res, err = client:setpeername( addr, serverport ) -- connect
if res or ( err == "timeout" ) then
local ip, port = client:getsockname( )
local interface = wrapclient( client, ip, serverport, listener, pattern, sslctx )
diff --git a/net/server_select.lua b/net/server_select.lua
index 50e439b1..bc86742c 100644
--- a/net/server_select.lua
+++ b/net/server_select.lua
@@ -1032,7 +1032,7 @@ local addclient = function( address, port, listeners, pattern, sslctx, typ )
return nil, err
end
client:settimeout( 0 )
- local ok, err = client:connect( address, port )
+ local ok, err = client:setpeername( address, port )
if ok or err == "timeout" or err == "Operation already in progress" then
return wrapclient( client, address, port, listeners, pattern, sslctx )
else