Giter VIP home page Giter VIP logo

chatofskynet's People

Contributors

coderhsc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

chatofskynet's Issues

消息发送

我使用你的客户端没有异常
我使用你的客户端向skynet发送消息时,服务器端出现异常,发生在接受消息时--
--排除到最后问题为消息没有注册
--这个问题的解决思路是这样的

有关传递消息

在客户端运行(你的例子里面的代码)
function messageManager:getProcessMessage(version,messageId,protobufMessage)
print("********")
print(protobufMessage)
local packA = string.pack(">hiz",version,messageId,protobufMessage)
local byteArrayA = ByteArray.new()
byteArrayA:writeBuf(packA)
local packAlen = byteArrayA:getLen() --得到长度
--多了个长度信息
local packB = string.pack(">hhiz",packAlen,version,messageId,protobufMessage)
local byteArrayB = ByteArray.new()
byteArrayB:writeBuf(packB)
return byteArrayB
end
在服务端建立连接接受到消息后不能正常解析消息(你例子的代码)
skynet.register_protocol {
name = "client",
id = skynet.PTYPE_CLIENT,
unpack = function (msg, sz)
return host:dispatch(msg, sz)
end,
..........
}
运行到这里出现警告
:0100000e] lua call [100000d to :100000e : 0 msgsz = 19] error : �[31m./lualib/skynet.lua:564: ./lualib/sproto.lua:111: bad argument #2 to 'unpack' (number expected, got no value)
stack traceback:
[C]: in function 'assert'
./lualib/skynet.lua:564: in function <./lualib/skynet.lua:544>�[0m
是否还缺少文件导致解析失败

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.