-- waits until connection is completed
function connect(skt,host, port)
skt:settimeout(0)
local ret,err = skt:connect (host, port)
if err=='timeout' then print('connect timeout.'); end
if ret or err ~= "timeout" then
print'ret'
return ret, err
end
_writing_log[skt] = os.time()
coroutine.yield(skt, _writing)
print'try connect'
ret,err = skt:connect (host, port)
_writing_log[skt] = nil
if (err=="already connected") then
return 1
end
return ret, err
end
the output is :
connect timeout.
Why?
Is it a copas bug?
Thanks.