Displaying 1 result from an estimated 1 matches for "hextcp".
Did you mean:
textcp
2005 Apr 14
0
Finding an available port for server socket
...nection(host, port, blocking = T)
writeLines(strings, outConn)
close(outConn)
}
availablePort <- function(){
## find a port that R can listen on
## just returns 40001 on Windows
portsInUse <- 0
os <- as.vector(Sys.info()["sysname"])
if(os == "Linux"){
hexTcp <- system("cat /proc/net/tcp | awk '{print $2}'", intern = T)
hexUdp <- system("cat /proc/net/udp | awk '{print $2}'", intern = T)
portsInUse <- hex2numeric(gsub(".*\:", "", c(hexTcp[-1], hexUdp[-1])))
}
if(os == "Sun...