From 39126c120fceb863d66d36196d0f80bb11967b8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=91=E9=A3=8E?= Date: Tue, 23 Jul 2013 12:13:46 +0800 Subject: [PATCH] socket.open can return error --- lualib/socket.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lualib/socket.lua b/lualib/socket.lua index 0532811d..7f5956b2 100644 --- a/lualib/socket.lua +++ b/lualib/socket.lua @@ -96,7 +96,7 @@ function socket.open(addr, port) local cmd = "open" .. " " .. (port and (addr..":"..port) or addr) local r = skynet.call(".socket", "text", cmd) if r == "" then - error(cmd .. " failed") + return nil, cmd .. " failed" end local fd = tonumber(r) READBUF[fd] = true