Closed HenrikBengtsson closed 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(*)
canPortBeUsed()
serverSocket(port)
(*) 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.
The internal
canPortBeUsed()
function rely solely onserverSocket(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.