mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 20:23:06 +00:00
socket.open can return error
This commit is contained in:
@@ -96,7 +96,7 @@ function socket.open(addr, port)
|
|||||||
local cmd = "open" .. " " .. (port and (addr..":"..port) or addr)
|
local cmd = "open" .. " " .. (port and (addr..":"..port) or addr)
|
||||||
local r = skynet.call(".socket", "text", cmd)
|
local r = skynet.call(".socket", "text", cmd)
|
||||||
if r == "" then
|
if r == "" then
|
||||||
error(cmd .. " failed")
|
return nil, cmd .. " failed"
|
||||||
end
|
end
|
||||||
local fd = tonumber(r)
|
local fd = tonumber(r)
|
||||||
READBUF[fd] = true
|
READBUF[fd] = true
|
||||||
|
|||||||
Reference in New Issue
Block a user