summaryrefslogtreecommitdiff
path: root/xmake/core/base/socket.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2022-07-05 23:07:51 +0800
committerruki <[email protected]>2022-07-05 23:07:51 +0800
commitc94c4d9aa8fe72a25358e89fa608f3457e9ee1f7 (patch)
tree5c00acd7ef42c0dfce82d1f17f5f1405b6d9c5c9 /xmake/core/base/socket.lua
parent61d5d3faef3360303c862a4db2e7101e17ac6aac (diff)
checkout timeout errors
Diffstat (limited to 'xmake/core/base/socket.lua')
-rw-r--r--xmake/core/base/socket.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/xmake/core/base/socket.lua b/xmake/core/base/socket.lua
index 615f28a0c..b9da2e99a 100644
--- a/xmake/core/base/socket.lua
+++ b/xmake/core/base/socket.lua
@@ -318,6 +318,8 @@ function _instance:send(data, opt)
local events, waiterrs = _instance.wait(self, socket.EV_SEND, opt.timeout or -1)
if events == socket.EV_SEND then
wait = true
+ elseif events == 0 then
+ os.raise("%s: send timeout!", self)
else
errors = waiterrs
break
@@ -385,6 +387,8 @@ function _instance:sendfile(file, opt)
local events, waiterrs = _instance.wait(self, socket.EV_SEND, opt.timeout or -1)
if events == socket.EV_SEND then
wait = true
+ elseif events == 0 then
+ os.raise("%s: sendfile timeout!", self)
else
errors = waiterrs
break
@@ -451,6 +455,8 @@ function _instance:recv(buff, size, opt)
local events, waiterrs = _instance.wait(self, socket.EV_RECV, opt.timeout or -1)
if events == socket.EV_RECV then
wait = true
+ elseif events == 0 then
+ os.raise("%s: recv timeout!", self)
else
data_or_errors = waiterrs
break