summaryrefslogtreecommitdiff
path: root/xmake/core/base/socket.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2020-01-31 00:31:03 +0800
committerruki <[email protected]>2020-01-30 21:06:19 +0800
commit4d8a3d38c1a199a2cff62b3ae725b00bfc67a296 (patch)
treecfaf5d3f0f4dc771a747de7155554f716ff39aa2 /xmake/core/base/socket.lua
parent4e2bb608354145ac86d85b418e9a2319eaed189e (diff)
improve scheduler and socket connect
Diffstat (limited to 'xmake/core/base/socket.lua')
-rw-r--r--xmake/core/base/socket.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/xmake/core/base/socket.lua b/xmake/core/base/socket.lua
index 7669ac455..079959538 100644
--- a/xmake/core/base/socket.lua
+++ b/xmake/core/base/socket.lua
@@ -666,7 +666,7 @@ function socket.bind(addr, port, opt)
local ok, errors = sock:bind(addr, port)
if not ok then
sock:close()
- return nil, string.format("bind %s:%s failed, errors: %s!", addr, port, errors or "")
+ return nil, string.format("bind %s:%s failed, errors: %s!", addr, port, errors or "unknown")
end
return sock
end
@@ -680,7 +680,7 @@ function socket.bind_unix(addr, opt)
local ok, errors = sock:bind_unix(addr, opt)
if not ok then
sock:close()
- return nil, string.format("bind unix://%s failed, errors: %s!", addr, errors or "")
+ return nil, string.format("bind unix://%s failed, errors: %s!", addr, errors or "unknown")
end
return sock
end
@@ -694,7 +694,7 @@ function socket.connect(addr, port, opt)
local ok, errors = sock:connect(addr, port, opt)
if ok <= 0 then
sock:close()
- return nil, string.format("connect %s:%s failed, errors: %s!", addr, port, errors or "")
+ return nil, errors
end
return sock
end
@@ -708,7 +708,7 @@ function socket.connect_unix(addr, opt)
local ok, errors = sock:connect_unix(addr, opt)
if ok <= 0 then
sock:close()
- return nil, string.format("connect unix://%s failed, errors: %s!", addr, errors or "")
+ return nil, errors
end
return sock
end