summaryrefslogtreecommitdiff
path: root/xmake/modules/private/service/client.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2022-07-05 23:19:12 +0800
committerruki <[email protected]>2022-07-05 23:19:12 +0800
commit75604a4d159a554bc6664f5d7a41f422fb256f20 (patch)
tree124eb46a67fc018ea6d5fa2117fda6fb08b1e376 /xmake/modules/private/service/client.lua
parent5ad5e57ffd468bdec13f292773c7413201a68184 (diff)
add connect timeout
Diffstat (limited to 'xmake/modules/private/service/client.lua')
-rw-r--r--xmake/modules/private/service/client.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/xmake/modules/private/service/client.lua b/xmake/modules/private/service/client.lua
index 4eb18d1a1..c3af668d8 100644
--- a/xmake/modules/private/service/client.lua
+++ b/xmake/modules/private/service/client.lua
@@ -33,6 +33,7 @@ function client:init()
-- init timeout
self._SEND_TIMEOUT = config.get("send_timeout") or -1
self._RECV_TIMEOUT = config.get("recv_timeout") or -1
+ self._CONNECT_TIMEOUT = config.get("connect_timeout") or -1
end
-- get send timeout
@@ -45,6 +46,11 @@ function client:recv_timeout()
return self._RECV_TIMEOUT
end
+-- get connect timeout
+function client:connect_timeout()
+ return self._CONNECT_TIMEOUT
+end
+
-- parse host address
function client:address_parse(address)
local addr, port, user