r-lib / pingr

ICMP and TCP ping and related tools
http://r-lib.github.io/pingr/
Other
34 stars 8 forks source link

ping fails, ping_port works #15

Closed dmenne closed 4 years ago

dmenne commented 4 years ago

Windows, R 4.0.0

ping("www.google.com")
[1] NA NA NA
> ping_port("www.google.com")
[1] 18.002 30.007 23.161

Is this "expected behavior"?

gaborcsardi commented 4 years ago

Well, what does system("ping www.google.com") do?

dmenne commented 4 years ago
library(pingr)
#> Warning: Paket 'pingr' wurde unter R Version 4.0.2 erstellt
system("ping www.google.com")
#> [1] 0
ping("www.google.com")
#> [1] NA NA NA
ping_port("www.google.com")
#> [1] 23.205 20.273 19.645

Created on 2020-06-29 by the reprex package (v0.3.0)

gaborcsardi commented 4 years ago

Yes, that is expected, because you don't have an external ping program.

ping() is pretty useless nowadays, anyway. If you want to check if a web server is up, use ping_port(). ping()'s success or failure will not tell you anything about that.