summaryrefslogtreecommitdiff
path: root/xmake/modules/private/service/client.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2022-07-05 22:40:05 +0800
committerruki <[email protected]>2022-07-05 22:40:05 +0800
commit61d5d3faef3360303c862a4db2e7101e17ac6aac (patch)
tree494898ac8eea80f9b83be0723379bd40a1912ffe /xmake/modules/private/service/client.lua
parent4ee209c6235385a6e2b4182cab870f14067a50d1 (diff)
add timeout
Diffstat (limited to 'xmake/modules/private/service/client.lua')
-rw-r--r--xmake/modules/private/service/client.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/xmake/modules/private/service/client.lua b/xmake/modules/private/service/client.lua
index 437a10f8a..92330fec4 100644
--- a/xmake/modules/private/service/client.lua
+++ b/xmake/modules/private/service/client.lua
@@ -22,12 +22,21 @@
import("core.base.object")
import("core.base.socket")
import("core.base.scheduler")
+import("private.service.client_config", {alias = "config"})
-- define module
local client = client or object()
-- init client
function client:init()
+
+ -- init timeout
+ self._TIMEOUT = config.get("timeout") or -1
+end
+
+-- get timeout
+function client:timeout()
+ return self._TIMEOUT
end
-- parse host address