diff options
author | Kim Alvefur <zash@zash.se> | 2018-10-12 17:36:34 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2018-10-12 17:36:34 +0200 |
commit | 75784460bb29c7f157e795b87a199cc9134bf90d (patch) | |
tree | 9e04d366c38c06a01edc5c3951a2f0f5c7ee03e1 /net/server_select.lua | |
parent | 0ae3ed3ea9857be8f49c0a7f0be4c93c3dbc4ea8 (diff) | |
download | prosody-75784460bb29c7f157e795b87a199cc9134bf90d.tar.gz prosody-75784460bb29c7f157e795b87a199cc9134bf90d.zip |
net.server: Swich method for connecting sockets with remotes
LuaSocket TCP sockets have have both :connect and :setpeername, which
are the exact same function, however UDP sockets only have :setpeername.
Switching to :setpeername allows most of this code to be generic wrt
TCP/UDP.
Diffstat (limited to 'net/server_select.lua')
-rw-r--r-- | net/server_select.lua | 2 |
1 files changed, 1 insertions, 1 deletions
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 |