connect timeout, see #611

This commit is contained in:
Cloud Wu
2017-04-13 15:32:54 +08:00
parent 61d13846cd
commit 312943c6a0
3 changed files with 27 additions and 4 deletions

View File

@@ -99,7 +99,7 @@ function httpc.request(method, host, url, recvheader, header, content)
if async_dns and not hostname:match(".*%d+$") then
hostname = dns.resolve(hostname)
end
local fd = socket.connect(hostname, port)
local fd = socket.connect(hostname, port, timeout)
local finish
if timeout then
skynet.timeout(timeout, function()