Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Socket 无法通信导致ReGetSockFail #154

Closed
AlitaLegend opened this issue Jul 29, 2022 · 1 comment
Closed

Socket 无法通信导致ReGetSockFail #154

AlitaLegend opened this issue Jul 29, 2022 · 1 comment

Comments

@AlitaLegend
Copy link

image
image

在游戏进程启动时,先执行CPP的注册代码,然后CPP启动Lua脚本,脚本中执行:
require("socket.core"); 报错如上图;

备注:launch.json 文件和文档上设置的一样.

@stuartwang
Copy link
Collaborator

socket.core 是luasocket库提供的。luapanda本身不提供socket能力。所以需要做的工作如下:

  1. 在运行环境引入 luasocket
  2. 在用户lua代码中加入socket.core运行,不报错即为引入成功

以下链接中有luasocket源码地址和我们自己编译的库,可以参考
https://github.com/Tencent/LuaPanda/tree/c5ef26fb52fb5d91cebea623178678f6091c1c64/luasocketBin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants