Git Product home page Git Product logo

Comments (5)

hufeng avatar hufeng commented on June 1, 2024

cool!

from dubbo-js.

hufeng avatar hufeng commented on June 1, 2024

welcome pull request 😃

from dubbo-js.

DanielYWoo avatar DanielYWoo commented on June 1, 2024

我是#5757的提出者, 我当时的诉求是我的某个应用里connection timeout比较短, 但是socket timeout比较长, 但是目前nodejs并不支持.
你们估计需要在 _initSocket 里面通过global.setTimeout(不是socket.setTimeout)去注册一下onClose, 然后onConnect里clearTimeout.

from dubbo-js.

hsiaosiyuan0 avatar hsiaosiyuan0 commented on June 1, 2024

@DanielYWoo 感谢提醒,不过我刚刚去看了源码,socket.setTimeout 应该大体上和你建议的方式差不多,调用过程如下:

到了这边会发现会实例化一个定时器,而这个定时器在未来 stream.onRead 或者 stream.onWrite 的时候,会被刷新,见:

所以我感觉运行结果应该会和 nodejs/node#5757 (comment) 中 bnoordhuis 的结果一样

from dubbo-js.

DanielYWoo avatar DanielYWoo commented on June 1, 2024

👍

from dubbo-js.

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.