GithubHelp home page GithubHelp logo

用poset man进行post,连续post 3次左右,post man提示 Error: socket hang up 了,前两次post均有返回成功,请问应该怎么解决? about jqhttpserver HOT 4 CLOSED

188080501 avatar 188080501 commented on July 23, 2024
用poset man进行post,连续post 3次左右,post man提示 Error: socket hang up 了,前两次post均有返回成功,请问应该怎么解决?

from jqhttpserver.

Comments (4)

188080501 avatar 188080501 commented on July 23, 2024

这个是postman这边的问题,上一次http连接没彻底断开就直接发起下一次http请求就报错
按照默认设置应该是1秒内发起第2次请求就能复现这个报错

from jqhttpserver.

188080501 avatar 188080501 commented on July 23, 2024

如果你想缓解这个问题,可以修改

void JQHttpServer::Session::onBytesWritten(const qint64 &written)

里面的

QTimer::singleShot( 1000, this, &QObject::deleteLater );

把1000设置到更小的值,这样可以加速session销毁速度

from jqhttpserver.

188080501 avatar 188080501 commented on July 23, 2024

为什么设置1000ms是因为某些环境下如果写入完成就直接断开连接,会导致client这边不能正常接收完数据就断开,因此留了1000ms的余量

from jqhttpserver.

188080501 avatar 188080501 commented on July 23, 2024

此问题已解决
801f463

from jqhttpserver.

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.