Giter VIP home page Giter VIP logo

Comments (5)

ldcsaa avatar ldcsaa commented on May 21, 2024 1

不定长也可以用PULL,只要包头能拿到包体的长度

from hp-socket.

ldcsaa avatar ldcsaa commented on May 21, 2024

可能你使用pull的方式有问题,正常情况下只要你的应用层协议定义得合理(包头包体清晰)是不需要调用HP_TcpPullServer_Peek方法的。可参考相关示例DEMO。

from hp-socket.

gmxyb avatar gmxyb commented on May 21, 2024

谢谢回答。我遇到的是别人定的不定长协议。。

from hp-socket.

gmxyb avatar gmxyb commented on May 21, 2024

大哥,就是因为包头也不定长,不然我也不会提这个了。。

from hp-socket.

ldcsaa avatar ldcsaa commented on May 21, 2024

如果不同包类型的包头长度固定或包头的最前字节为包类型和包头长度还好处理,可以对包头进行二次解析。否则只能自己处理了,或者直接用PUSH模型。

from hp-socket.

Related Issues (20)

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.