Skip to content
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

add new flag --sync-ping #2

Merged
merged 4 commits into from
Oct 27, 2017
Merged

add new flag --sync-ping #2

merged 4 commits into from
Oct 27, 2017

Conversation

ramok
Copy link
Contributor

@ramok ramok commented Oct 19, 2017

No description provided.

Looks like after this patch flag --sync-ping not necessary?
@famzah
Copy link
Owner

famzah commented Oct 23, 2017

Hi @ramok. I have two things to discuss:

  • What is the practical purpose of this new switch? When do we need to send the same amount of pings?

  • Let's call the newly added code in print_ping_data() the "trigger new ping for all hosts" code. I think that we shouldn't place the "trigger new ping for all hosts" code in print_ping_data(), because it has nothing to do with printing data. Additionally, right now it delays the printing until all hosts returned a ping (or timed out) which defers the real-time printing of results. Why do we want to wait until all hosts return data, and then finally print all ping results at once?

    • I think we should leave print_ping_data() with no changes, so that we see the ping results immediately (asynchronously).
    • The "trigger new ping for all hosts" code should go in a separate function named trigger_sync_ping(), for example, which should be part of main while(1) loop along with handle_pressed_keys(), print_ping_data(), etc.

@famzah
Copy link
Owner

famzah commented Oct 23, 2017

One other thing. The new short -s option is the same as the old -s (which we removed). In order to avoid confusion, shouldn't we use another short option? Maybe -S (upper-case)?

In order to avoid confusion with old option -s
@ramok
Copy link
Contributor Author

ramok commented Oct 24, 2017

What is the practical purpose of this new switch? When do we need to send the same amount of pings?

There is example. In ping-multi on top I cannot say if host 192.168.0.2 and 192.168.0.3 going down in same time or not. If they going down in same time, most likely problem not in this hosts, but in switch or cable which they are connected together.
I found this very useful :)

All your remark are absolutely right, I will make fix according them.

@famzah famzah merged commit ae225e2 into famzah:master Oct 27, 2017
@famzah
Copy link
Owner

famzah commented Oct 27, 2017

Thank you for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants