Giter Club home page Giter Club logo

Comments (2)

ihipop avatar ihipop commented on July 28, 2024

swoole/swoole-src#2184

from saber.

twose avatar twose commented on July 28, 2024

最近太忙了没有及时回复
这个地方所有人都存在严重的误解...认为连接断开客户端能立即侦测到并且重连, 这是不可能的, 网络波动或是连接断开可能发生在任意时刻, 底层keep_liveness只是一个基本的保障, 保证在由于连接悬挂时间过长的情况下(超过keep-alive指定时间), 下一次请求能够不失败(屏蔽连接的概念, 和curl一样只管请求就可以了), 这里你的请求频次过高, 可能触发了服务器端的保护机制, 总之连接断开了, 并且由于请求速度过快, 在客户端keep_liveness检测的时候, 操作系统内核并没有收到对端close连接的挥手, 导致keep_liveness检查仍是成功的, 然后在收包等待过程中, 内核才发现连接断开, 导致recv返回连接断开信息, 此时该次请求是在半途失败的, 底层不便于重新发起请求, 应由开发者自行决定是否重新请求, 所以开发者必须自己捕获这样的错误, 重新调用get方法, 此时底层会自动重连(屏蔽了连接的概念, 和curl一样, 会返回错误, 但不用关心连接), 然后就会发现可以继续请求了

from saber.

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.