Coder Social home page Coder Social logo

pingr's People

Contributors

gaborcsardi avatar pekkarr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pingr's Issues

Timeout during connect, for ping_port

Need to connect in non-blocking mode, wait until connected, or the timeout is up, and then switch back to blocking mode. Maybe we don't even have to switch back....

ping fails, ping_port works

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"?

Also skipped on CRAN?

checking tests ... ERROR
Running the tests in ‘tests/testthat.R’ failed.
Last 13 lines of output:
  LENGTH or similar applied to closure object
  1: withCallingHandlers(eval(code, new_test_environment), error = capture_calls, message = function(c) invokeRestart("muffleMessage"), 
         warning = function(c) invokeRestart("muffleWarning"))
  2: eval(code, new_test_environment)
  3: eval(expr, envir, enclos)
  4: ping_port("127.0.0.1", port = tools:::httpdPort, count = 1) at test-tcp.r:13

  testthat results ================================================================
  OK: 15 SKIPPED: 0 FAILED: 1
  1. Error: We can ping localhost 

  Error: testthat unit tests failed
  Execution halted

LICENSE file contents

Hi @gaborcsardi, I see that the license is declared in the bottom of the README, but would it be possible to update the LICENSE file to include the text of the MIT license so that GitHub picks it up and reports it properly?

Test failure with dev testthat

I see

checking tests ... ERROR
Running the tests in ‘tests/testthat.R’ failed.
Last 13 lines of output:
  1. Error: We can ping localhost ------------------------------------------------
  LENGTH or similar applied to closure object
  1: withCallingHandlers(eval(code, new_test_environment), error = capture_calls, message = function(c) invokeRestart("muffleMessage"))
  2: eval(code, new_test_environment)
  3: eval(expr, envir, enclos)
  4: ping_port("127.0.0.1", port = tools:::httpdPort, count = 1) at test-tcp.r:13

  testthat results ================================================================
  OK: 15 SKIPPED: 0 FAILED: 1
  1. Error: We can ping localhost 

  Error: testthat unit tests failed
  Execution halted

Rewrite ICMP ping in C

Because the various ping programs work differently, e.g. take different arguments, etc.

Upkeep for pingr (2023)

Pre-history

  • usethis::use_readme_rmd()
  • usethis::use_roxygen_md()
  • usethis::use_github_links()
  • usethis::use_pkgdown_github_pages()
  • usethis::use_tidy_github_labels()
  • usethis::use_tidy_style()
  • urlchecker::url_check()

2020

  • usethis::use_package_doc()
  • usethis::use_testthat(3)
  • Align the names of R/ files and test/ files

2021

  • Remove check environments section from cran-comments.md
  • Use lifecycle instead of artisanal deprecation messages

2022

  • Handle and close any still-open master --> main issues
  • usethis:::use_codecov_badge("r-lib/pingr")
  • Update pkgdown site using instructions at https://tidytemplate.tidyverse.org
  • Update lifecycle badges with more accessible SVGs: usethis::use_lifecycle()

2023

  • Update copyright holder in DESCRIPTION: person("Posit Software, PBC", role = c("cph", "fnd"))
  • Run devtools::document() to re-generate package-level help topic with DESCRIPTION changes
  • usethis::use_tidy_logo()
  • usethis::use_tidy_coc()
  • Use pak::pak("r-lib/pingr") in README
  • Consider running usethis::use_tidy_dependencies() and/or replace compat files with use_standalone()
  • #28
  • #29
    or file an issue if you don't have time to do it now
  • Change files ending in .r to .R in R/ and/or tests/testthat/
  • #30

Eternal

  • usethis::use_mit_license()
  • usethis::use_package("R", "Depends", "3.6")
  • usethis::use_tidy_description()
  • usethis::use_tidy_github_actions()
  • devtools::build_readme()
  • Re-publish released site if needed

Created on 2023-11-03 with usethis::use_tidy_upkeep_issue(), using usethis v2.2.2.9000

timeout*1000 is harmful!

I don't know whether this also affects windows users, but the sys call to ping on linux is executed with timeout * 1000 passed to -W argument. My man ping (ubuntu 16.04) says:

       -W timeout
              Time to wait for a response, in **seconds**. The option affects only timeout in 
              absence of  any responses, otherwise ping waits for two RTTs.

Therefore calling ping('lalala.com') dead-locks the R session (ok, actually, only affects Rstudio, and not the terminal, but nonetheless).
The documentation does not say anything about the measurement units, and the default for timeout argument is set to 1,

IMO, two things should be changed:

  1. Documentation should be clear about the units
  2. The default should be max 10 seconds

Move `master` branch to `main`

The master branch of this repository will soon be renamed to main, as part of a coordinated change across several GitHub organizations (including, but not limited to: tidyverse, r-lib, tidymodels, and sol-eng). We anticipate this will happen by the end of September 2021.

That will be preceded by a release of the usethis package, which will gain some functionality around detecting and adapting to a renamed default branch. There will also be a blog post at the time of this master --> main change.

The purpose of this issue is to:

  • Help us firm up the list of targetted repositories
  • Make sure all maintainers are aware of what's coming
  • Give us an issue to close when the job is done
  • Give us a place to put advice for collaborators re: how to adapt

message id: euphoric_snowdog

Verbose

Print and count at the same time

Release pingr 2.0.3

Prepare for release:

  • git pull
  • Check current CRAN check results
  • Polish NEWS
  • usethis::use_github_links()
  • urlchecker::url_check()
  • devtools::build_readme()
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • revdepcheck::revdep_check(num_workers = 8)
  • Update cran-comments.md
  • git push

Submit to CRAN:

  • usethis::use_version('patch')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted 🎉
  • usethis::use_github_release()
  • usethis::use_dev_version(push = TRUE)

Error while utilizing `nsl` within a data.frame

It would be nice to be able to utilize these functions within a data.frame but I think some of the checks are causing it to fail. Here is an example.

data <- data.frame(
  id = 1:3,
  dmarc_string = c("_dmarc.google.com", "_dmarc.shopify.com", "_dmarc.walmart.com")
)

update_df <- data |>
  dplyr::mutate(
    dmarc_record = pingr::nsl(domain=dmarc_string, type=16L)[["answer"]]["data"]
  )

Error: Problem with `mutate()` column `dmarc_record`.
i `dmarc_record = pingr::nsl(domain = dmarc_string, type = 16L)[["answer"]]["data"]`.
x is_string(domain) is not TRUE

Unit of return of ping_port is not clear

As stated in the R doc ping gives response time in seconds while it is not clearly specified for ping_port. According to the c code the result should be in ms.

Cannot suppress warnings or messages from is_online()

hi @gaborcsardi,

It seems it is not possible to suppress either warnings or messages from is_online(), perhaps because they are neither. Still, it would be nice to be able to quiet is_online()...

> suppressMessages(pingr::is_online())
ping: google-public-dns-a.google.com: Temporary failure in name resolution
ping: b.resolvers.Level3.net: Temporary failure in name resolution
connect: Network is unreachable
connect: Network is unreachable
[1] FALSE
> suppressWarnings(pingr::is_online())
ping: google-public-dns-a.google.com: Temporary failure in name resolution
ping: b.resolvers.Level3.net: Temporary failure in name resolution
connect: Network is unreachable
connect: Network is unreachable
[1] FALSE

I believe this results from using the system() function:

output <- suppressWarnings(system(os$cmd, intern = ! verbose))

Could you not change that system call to:

output <- suppressWarnings(
                   system(os$cmd, intern = ! verbose,
                               ignore.stdout = TRUE, ignore.stderr = TRUE)
) 

Internet Connection

Can I use some pingr function to leave my RStudio online? When I use the is.online () command, the answer is FALSE.

Upkeep for pingr

Pre-history

  • usethis::use_readme_rmd()
  • usethis::use_roxygen_md()
  • usethis::use_github_links()
  • usethis::use_pkgdown_github_pages()
  • usethis::use_tidy_github_labels()
  • usethis::use_tidy_style()
  • usethis::use_tidy_description()
  • urlchecker::url_check()

2020

  • usethis::use_package_doc()
    Consider letting usethis manage your @importFrom directives here.
    usethis::use_import_from() is handy for this.
  • usethis::use_testthat(3) and upgrade to 3e, testthat 3e vignette
  • Align the names of R/ files and test/ files for workflow happiness.
    usethis::rename_files() can be helpful.

2021

  • usethis::use_tidy_dependencies()
  • usethis::use_tidy_github_actions() and update artisanal actions to use setup-r-dependencies
  • Remove check environments section from cran-comments.md
  • Bump required R version in DESCRIPTION to 3.4
  • Use lifecycle instead of artisanal deprecation messages, as described in Communicate lifecycle changes in your functions
  • Add RStudio to DESCRIPTION as funder, if appropriate

2022

Add support for parsing SRV records to nsl()

Could support for parsing SRV records be added to nsl()?

I've been looking for a self-contained way to query SRV records, ultimately to enable shiny apps to find plumber API endpoints in a micro-services environment. pingr::nsl() is allllmost there. 😄

Release pingr 2.0.1

Prepare for release:

  • git pull
  • Check current CRAN check results
  • Polish NEWS
  • devtools::build_readme()
  • urlchecker::url_check()
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • rhub::check_for_cran()
  • rhub::check(platform = 'ubuntu-rchk')
  • rhub::check_with_sanitizers()
  • revdepcheck::revdep_check(num_workers = 8)
  • Update cran-comments.md
  • git push

Submit to CRAN:

  • usethis::use_version('patch')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted 🎉
  • git push
  • usethis::use_github_release()
  • usethis::use_dev_version()
  • git push

pingr update from CRAN

Version: 2.0.2
Check: whether package can be installed
Result: WARN 
  Found the following significant warnings:
    rping.c:101:13: warning: too many arguments for format [-Wformat-extra-args]
  See ‘/home/hornik/tmp/R.check/r-devel-gcc/Work/PKGS/pingr.Rcheck/00install.out’ for details.
  * used C compiler: ‘gcc-13 (Debian 13.2.0-5) 13.2.0’
Flavor: [r-devel-linux-x86_64-debian-gcc](https://www.r-project.org/nosvn/R.check/r-devel-linux-x86_64-debian-gcc/pingr-00check.html)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.