Coder Social home page Coder Social logo

包头的问题 about stick HOT 18 CLOSED

Ants-double avatar Ants-double commented on May 20, 2024
包头的问题

from stick.

Comments (18)

lvgithub avatar lvgithub commented on May 20, 2024

你是包头对于这个库来说,其实也属于内容。你把整个的长度算下,传输获取后,再解析你自定义呢包头。

from stick.

Ants-double avatar Ants-double commented on May 20, 2024

长度是变化的,不是固定的,我要接收到一条流后才可以知道 啊

from stick.

Ants-double avatar Ants-double commented on May 20, 2024

ok ,i change some code to fix my code.thankyou.

from stick.

lvgithub avatar lvgithub commented on May 20, 2024

方便把你的代码贴一下吗,我看下怎么修改,或者我把这个库升级成更灵活一些

from stick.

lvgithub avatar lvgithub commented on May 20, 2024

长度变化的是正常的,可以动态计算后下进行发送

from stick.

lvgithub avatar lvgithub commented on May 20, 2024

下一个版本我准备支持直接发送对象的形式,封装组装包长度的细节

from stick.

HelloKevinTian avatar HelloKevinTian commented on May 20, 2024

建议对自定义包头有更详细的文档和支持。比如一般协议的包头:msgLength+protoId+msgContent

from stick.

lvgithub avatar lvgithub commented on May 20, 2024

可以有

from stick.

lvgithub avatar lvgithub commented on May 20, 2024

疑问满满的,为什么我把数据打印出来发现,只是数据转发了一下,加了长度,其他都没有变化呢?没有看到实现解决粘连啊?是不是我用错了?

贴下你用的代码

from stick.

zhengxinvip avatar zhengxinvip commented on May 20, 2024

ok ,i change some code to fix my code.thankyou.

您好,我遇到和您一样的问题,请问可以给一下指点吗 谢谢

from stick.

lvgithub avatar lvgithub commented on May 20, 2024

ok ,i change some code to fix my code.thankyou.

您好,我遇到和您一样的问题,请问可以给一下指点吗 谢谢

说下你的打包方式,或者你看example里面的示例打包

from stick.

zhengxinvip avatar zhengxinvip commented on May 20, 2024

ok ,i change some code to fix my code.thankyou.

您好,我遇到和您一样的问题,请问可以给一下指点吗 谢谢

说下你的打包方式,或者你看example里面的示例打包

您好,您的代码包头长度设置为2字节或四字节,如果我想自定义传输协议,将包头定义为校验码+命令参数(1---传输消息 2----传输图片)+包头长度,我如何扩展,初学者,希望给予指点,谢谢。

from stick.

zhengxinvip avatar zhengxinvip commented on May 20, 2024

包头长度应修改为包体长度

from stick.

lvgithub avatar lvgithub commented on May 20, 2024

按照包这个架子的规范,需要设置为一个包头,包体内容你可以再自定义自己的协议内容,如果你需要完全自定义包头,那你就需要改源码了。

from stick.

zhengxinvip avatar zhengxinvip commented on May 20, 2024

您这里的包头的内容指的是包体的长度是吗

from stick.

lvgithub avatar lvgithub commented on May 20, 2024

是的

from stick.

zhengxinvip avatar zhengxinvip commented on May 20, 2024

谢谢 。我尝试修改源码 ,如果有不懂的问题希望还能得到您的帮助。

from stick.

zhengxinvip avatar zhengxinvip commented on May 20, 2024

是的

您好 请问一下如何我想设置命令参数(1---传输消息 2----传输图片)这样 这样包头里面的命令参数有两个可能的值 1 或者 2 那我如何将这个变量通过writeUInt16BE写入到缓冲区传递给接收端 希望您能提供帮助 谢谢

from stick.

Related Issues (13)

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.