Git Product home page Git Product logo

Comments (6)

Johance2 avatar Johance2 commented on May 5, 2024

这个没有问题的, len = m_socket.Receive(m_recvBuf, 0, kBufferSize, SocketFlags.None);
每次都是在 m_recvBuf的 0 位置才是写入收到的数据的。

from noahgameframe.

bluesky7290 avatar bluesky7290 commented on May 5, 2024

测试确实不是这里的问题,接收的时候246行会break掉,ConstDefine.MAX_PACKET_LEN设置1024小一点的时候很快出现,好像接收缓冲区(m_recvPool)只增不减,我在dispatchMsgs()方法while结束加上m_recvPool.Reset()问题好像解决了

from noahgameframe.

Johance2 avatar Johance2 commented on May 5, 2024

MAX_PACKET_LEN 这个是包的最大长度,如果你发的包超过这个,肯定会出问题的。
这个是事先计好的。 m_recvPool.Reset() 你加了这个会导致断包的。

from noahgameframe.

Johance2 avatar Johance2 commented on May 5, 2024

还有,我的m_recvPool是环形缓冲区。 一直绕圈圈的。 到尾部了,会重新再走一圈的。

from noahgameframe.

Johance2 avatar Johance2 commented on May 5, 2024

除非你,的单个包大小,超过我设定的最大包的长度,这就会出现问题。
要嘛设置大点,要吗通讯包,自己不要设计太大。

from noahgameframe.

bluesky7290 avatar bluesky7290 commented on May 5, 2024

抱歉,刚才服务端客户端一起测试,是我的问题,你的是对的,谢谢

from noahgameframe.

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.