You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2019/11/06 14:29:21 UTC
[GitHub] [dubbo-js] hsiaosiyuan0 commented on issue #57: may we have to
implement a timeout when reconnecting
hsiaosiyuan0 commented on issue #57: may we have to implement a timeout when reconnecting
URL: https://github.com/apache/dubbo-js/issues/57#issuecomment-550334200
@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` 的时候,会被刷新,所以从代码上来看,应该会和 https://github.com/nodejs/node/issues/5757#issuecomment-305969057 中 bnoordhuis 的结果一样
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org