point-source / dart_ping

Multi-platform network ping utility for Dart
30 stars 13 forks source link

Windows default timeout is 2 milliseconds #37

Closed ckerens closed 1 year ago

ckerens commented 1 year ago

The Windows ping command expects timeout in milliseconds, but is getting a default value of 2.

ping -w 2 -i 1 -4 -n 2 google.com

On line 46, timeout should be multiplied by 1000: https://github.com/point-source/dart_ping/blob/fd187809108ee5ee6108e33462206498b2b50257/dart_ping/lib/src/ping/windows_ping.dart#L43-L48

point-source commented 1 year ago

Thanks for the PR. I've merged it and published a new version.

I know you edited your initial issue to remove the discussion point about Int vs double but I'd still be open to discussing it if that's something you still care about.

ckerens commented 1 year ago

I changed my mind on the topic. I couldn't think of a good enough usecase to justify inconsistent behavior across platforms or potentially breaking existing dependencies.