Comments (5)
cool!
from dubbo-js.
welcome pull request 😃
from dubbo-js.
我是#5757的提出者, 我当时的诉求是我的某个应用里connection timeout比较短, 但是socket timeout比较长, 但是目前nodejs并不支持.
你们估计需要在 _initSocket 里面通过global.setTimeout(不是socket.setTimeout)去注册一下onClose, 然后onConnect里clearTimeout.
from dubbo-js.
@DanielYWoo 感谢提醒,不过我刚刚去看了源码,socket.setTimeout
应该大体上和你建议的方式差不多,调用过程如下:
- https://github.com/nodejs/node/blob/1447a79dc435578bffba32ead9b2ffa0425fc30a/lib/net.js#L452
- https://github.com/nodejs/node/blob/4aca277f16b8649b5fc21d41f340fad0a47c2e61/lib/internal/stream_base_commons.js#L240
- https://github.com/nodejs/node/blob/4aca277f16b8649b5fc21d41f340fad0a47c2e61/lib/internal/timers.js#L345
到了这边会发现会实例化一个定时器,而这个定时器在未来 stream.onRead
或者 stream.onWrite
的时候,会被刷新,见:
所以我感觉运行结果应该会和 nodejs/node#5757 (comment) 中 bnoordhuis 的结果一样
from dubbo-js.
👍
from dubbo-js.
Related Issues (20)
- Implement communication with Dubbo Java and Dubbo Go HOT 1
- Improve the configuration of husky + commitlint HOT 1
- Improve documentation (Node aspect) HOT 4
- Improve documentation (Web aspect)
- Improve documentation (Node aspect) HOT 2
- Improve documentation (Node aspect) HOT 2
- Improve documentation (Node aspect) HOT 1
- Improve documentation (Web aspect) HOT 3
- Improve documentation (Web aspect) HOT 2
- Improve documentation (Web aspect) HOT 2
- Improve documentation (Web aspect) HOT 1
- Improve documentation (Web aspect) HOT 2
- I'll handle the items
- Implement Load Balance HOT 1
- Implement Traffic Routing HOT 1
- Implement Service Discovery HOT 1
- Implement Filter HOT 1
- Implement Metrics HOT 1
- Implement Tracing HOT 1
- [API Bug]: dubboNodeAdapter HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dubbo-js.