Comparison

net/server_select.lua @ 5959:9e3b15199ec5

net/server_select: addclient: Check for failure correctly; remove wrapconnection call on failure
author daurnimator <quae@daurnimator.com>
date Wed, 18 Dec 2013 17:54:31 -0500
parent 5957:3c5061d937dd
child 5960:2a6edd4678c5
comparison
equal deleted inserted replaced
5958:451b4649fad2 5959:9e3b15199ec5
934 local client, err = luasocket.tcp( ) 934 local client, err = luasocket.tcp( )
935 if err then 935 if err then
936 return nil, err 936 return nil, err
937 end 937 end
938 client:settimeout( 0 ) 938 client:settimeout( 0 )
939 _, err = client:connect( address, port ) 939 local ok, err = client:connect( address, port )
940 if err then -- try again 940 if ok or err == "timeout" then
941 return wrapclient( client, address, port, listeners, pattern, sslctx ) 941 return wrapclient( client, address, port, listeners, pattern, sslctx )
942 else 942 else
943 return wrapconnection( nil, listeners, client, address, port, "clientport", pattern, sslctx ) 943 return nil, err
944 end 944 end
945 end 945 end
946 946
947 --// EXPERIMENTAL //-- 947 --// EXPERIMENTAL //--
948 948