futureverse / parallelly

R package: parallelly - Enhancing the 'parallel' Package
https://parallelly.futureverse.org
130 stars 7 forks source link

canPortBeUsed(): Upgrade to better, native implementation from port4me' #110

Closed HenrikBengtsson closed 9 months ago

HenrikBengtsson commented 9 months ago

The internal canPortBeUsed() function rely solely on serverSocket(port) to infer if a TCP port is available or not. That's not always sufficient. In port4me, we added a more robust check(*)

(*) Adopted from https://github.com/ropensci/ssh/blob/master/src/tunnel.c. FWIW, there's now also https://github.com/jeroen/curl/blob/master/src/findport.c, which stems from the former.