Skip to content

Conversation

@xgfone
Copy link

@xgfone xgfone commented Oct 8, 2019

The socket SOCK_RAW only returns the response packets by the destination ip. So it will receive all the ICMP responses. If pinging a site concurrently, the request ids of which are not the same, the ID and the Seq of response may not be the same as those of request.

However, we can add a function/method for Client to check and to filter them until receiving the right response. Of course, we can set it to nil to receiving all the response, but only the first is returned as the response.

Copy link
Owner

@glinton glinton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this, I have a change I will be pushing in a while that may cause some conflicts for this PR. I like what you've added though. Sorry for the delay getting to this.

@@ -1,4 +1,4 @@
package ping_test
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do prefer having a separate package for testing libraries unless i'm testing unexported functions directly, which is something that could be done..

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you are right! I've changed it to the origin.

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.

2 participants