go-ping / ping

ICMP Ping library for Go
MIT License
1.31k stars 344 forks source link

Add packet timeout option and make latency more accurate #224

Closed flizaga closed 1 year ago

flizaga commented 1 year ago

Two major improvements :

Small improvement :

fkr commented 1 year ago

@flizaga I came across the timeout a while ago and also wanted to add a default timeout - however if I understand correctly you chose 15 seconds default timeout. I would've gone for 10 (which is the default in the linux and BSD implementations of ping). (side note: windows has 4 seconds default timeout).

SuperQ commented 1 year ago

FYI: This project is abandoned as we are unable to maintain it due to lack of maintainers with admin rights on the repo. See #221

flizaga commented 1 year ago

Well, indeed, regarding the default timeout, I should have used a system default one, as it's possible to set it up to 10 for linux and BSD and 4 to windows. If I had think a bit much more I should have set the Timeout ticker every one seconds, as I don't think people would need a timeout under a second, and usually everyone will setup a integer number of seconds for the packet timeout.

Regarding the other topics : better accuracy on ping RTT both on linux/bsd and windows (and finally a ping that goes under the ms for the RTT (default Windows ping is not able to do it), what do you think ?

P.S. : it's the first time I code in Go, so I hope my code is respecting the coding standards.

SuperQ commented 1 year ago

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