-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use timeout option when timeout config option is set #101
Conversation
Thanks for your patch. But, that's in purpose to use -w instead of -W.
Let me know if I am wrong.
According to my experience, the option you suggest cannot guarantee the
command exits within that period.
Usually, I don't care how many pings have been sent. But, I do care there
is a response (no matter success or not) within a certain time frame.
That's why I use the deadline option. It returns immediately after getting
first successful response. Otherwise, it is guaranteed to be closed for
seconds I defined.
在 2019年8月22日週四 18:44,sa-linetco <[email protected]> 寫道:
… fixes #100 <#100>
------------------------------
You can view, comment on, or merge this pull request online at:
#101
Commit Summary
- use timeout option when timeout config option is set
File Changes
- *M* lib/builder/linux.js
<https://github.com/danielzzz/node-ping/pull/101/files#diff-0> (2)
Patch Links:
- https://github.com/danielzzz/node-ping/pull/101.patch
- https://github.com/danielzzz/node-ping/pull/101.diff
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#101?email_source=notifications&email_token=AA5YBI7ZFMSQCC4XGMGTIKLQFZUZ7A5CNFSM4IOTRXE2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HGX6OZQ>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA5YBI3LBORB5ONK4SIJ53DQFZUZ7ANCNFSM4IOTRXEQ>
.
|
With the timeout option set, ping also immediately returns on the first successful ping.
As described in #100 The difference between timeout and deadline is that deadline will ignore the count parameter in case the ping requests are not being answered. But as ping is called with |
If you want to conserve the possibility to set the deadline option on the javascript side, I'd suggest adding a |
I have done some experiments regarding to the In your scenario, one ping packet, both options guarantee the exit time of command
For host is reachable case, the result sames as the unreachable case mentioned above. To conclude, I agree with your changes on timeout option ( Would you mind to help me to implement them? |
Sure thing! As I do not have a mac available, could you please make sure that the mac version also inherits the unix ping options of |
Thanks.
For the MAC one, I will check that later on. For the window one, I agree
with your solution.
在 2019年8月23日週五 15:23,sa-linetco <[email protected]> 寫道:
… Would you mind to help me to implement them?
Sure thing! As I do not have a mac available, could you please make sure
that the mac version also inherits the unix ping options of -w for
deadline and -W for timeout?
On the windows parameter builder I'd suggest to log a warning if deadline
option is used.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#101?email_source=notifications&email_token=AA5YBI2UOYRYRQ7SITXYNUTQF6F67A5CNFSM4IOTRXE2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD47LSPQ#issuecomment-524204350>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA5YBIY24LYNZPRSUXGKKN3QF6F67ANCNFSM4IOTRXEQ>
.
|
For now I implemented the same behaviour for mac as I did for windows. When the deadline option is set, an error is thrown. |
Another fact I found out while working on this: Example (windows, unreachable ip):
Example (windows, reachable ip)
Example (linux, unreachable ip):
Example (linux, reachable ip)
|
Thanks. These are great, and high quality patch.
Conclusion
Experiments from MAC OSBelow are experiments on MAC OS Not reachable casesdeadline option
timeout option
Reachable casedeadline
Timeout
|
Sure thing, I'll get on it later today. |
Timeout: 7
The documentation for the configuration objects states that
My suggestion for the
|
Address the discussions on `timeout` and `deadline` in the README
Great. Thanks for your patch. I have link up the discussions here in the README. If there are no problems at all, I will merge this MR in a day or 2 |
Hi @mondwan , are there any problems that arose with this version which need addressing? |
Ah, I forgot to press the button. Thanks for the remind. |
Thanks for the merge! Do you have any info on when to expect a release on npm? |
No idea. You need to contact danielzzz directly since I don't have access
on npm
在 2019年9月17日週二 15:39,sa-linetco <[email protected]> 寫道:
… Thanks for the merge! Do you have any info on when to expect a release on
npm?
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#101?email_source=notifications&email_token=AA5YBI3TLFP4EZWPPRSH6PDQKCCS3A5CNFSM4IOTRXE2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD63TSSQ#issuecomment-532101450>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA5YBIYT3VXTPHIEEQN2P3LQKCCS3ANCNFSM4IOTRXEQ>
.
|
fixes #100