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

上一个问题是怀疑有冲突问题。现在确认了是在协程下的绑定有问题 #17

Open
dqzg12300 opened this issue Aug 29, 2018 · 2 comments

Comments

@dqzg12300
Copy link

上次是在skynet中测试。发现在skynet.start中无法正常解码
然后经过一段时间的观察。并且问了skynet的作者。结论是你这边在协程中的绑定lua时的问题。
测试代码如下

pb.import_proto_file("login.proto")
local pbstr = pb.encode("login.login", {account="king",password="111111"})
print("encode")
local pbmsg=pb.decode("login.login",pbstr)
print(tool.dump(pbmsg))
print("=========================")
local cor=coroutine.create(function()
local msg= pb.decode("login.login", pbstr)
print("decode")
print(tool.dump(msg))
end)
coroutine.resume(cor)

打印结果如下
encode
{
["password"] = "111111",
["sdkid"] = 0,
["account"] = "king",
}

decode
"
king111111"

@jinq0123
Copy link
Owner

协程中调用时会出错,见 issue #6, 原因为 SteveKChiu/lua-intf#131

@jinq0123
Copy link
Owner

让我在README中加个说明。

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