add result of accept

This commit is contained in:
zixun
2019-10-30 14:14:28 +08:00
committed by 云风
parent 4585da9cbd
commit 8450e7f366
2 changed files with 7 additions and 2 deletions

View File

@@ -43,7 +43,10 @@ if MODE == "agent" then
skynet.start(function () skynet.start(function ()
skynet.dispatch("lua", function (_,_, id, protocol, addr) skynet.dispatch("lua", function (_,_, id, protocol, addr)
websocket.accept(id, handle, protocol, addr) local ok, err = websocket.accept(id, handle, protocol, addr)
if not ok then
print(err)
end
end) end)
end) end)

View File

@@ -407,9 +407,11 @@ function M.accept(socket_id, handle, protocol, addr)
try_handle(ws_obj, "error") try_handle(ws_obj, "error")
end end
else else
error(err) -- error(err)
return false, err
end end
end end
return true
end end