go-ping / ping

ICMP Ping library for Go
MIT License
1.33k stars 345 forks source link

Add packet timeout callback #50 #176

Closed haylinmoore closed 1 year ago

haylinmoore commented 3 years ago

My approach to fixing #50. It should be noted that CheckAwaitingSequences will only be called everytime a ping is attempted so accuracy in terms of PacketTimeout is as accurate as Interval.

SuperQ commented 3 years ago

It might also be worth looking at https://github.com/go-ping/ping/pull/152.

haylinmoore commented 3 years ago

If that ever gets merged I can adapt this system to use that for identification

SuperQ commented 3 years ago

This needs a rebase now that #177 is merged.

SuperQ commented 3 years ago

Another way to improve the timeout reporting accuracy would be to setup a time.Timer in the main packet loop.

haylinmoore commented 3 years ago

I’ll look into using time.Timer

SuperQ commented 2 years ago

This needs a rebase.

SuperQ commented 1 year ago

See https://github.com/go-ping/ping/pull/226