请问pbc的Lua绑定是不是不支持fixed数据类型?
支持 - 回复 | (2644) | 云风 | 2013-04-08 11:45:27
但是当我使用fixed32类型时,出现了下面的错误:lua: ./protobuf.lua:248: Need a lightuserdata for int32 - 回复 | (2646) | Apache | 2013-04-08 08:42:00
但是当我使用fixed32类型时,就会出现下面的错误:./protobuf.lua:248: Need a lightuserdata for int32
我的proto和测试代码如下:package person;message Person { required fixed32 id = 1; required string name = 2; repeated int32 bookids = 3;}
pb = require "protobuf"pbbuff = io.open("./Person.pb", "rb"):read("*a")pb.register(pbbuff)
local new_person = { id = 103, name = "Apache", bookids = {33, 22, 11}}new_person_buf = pb.encode("person.Person", new_person)