X-Git-Url: http://christophe.rhodes.io/gitweb/?p=swankr.git;a=blobdiff_plain;f=swank.R;h=ebf580c510af115b66c703f4557797917b72c27e;hp=8c5bafdccd1d5d198f534d971db0455fba703095;hb=d4dba776122f9750b3e0d2c1ba7d1f8ec127642a;hpb=f362dbb2a366f194cb12a336d99403287e09f8ae diff --git a/swank.R b/swank.R index 8c5bafd..ebf580c 100644 --- a/swank.R +++ b/swank.R @@ -18,10 +18,15 @@ swank <- function(port=4005) { } startSwank <- function(portFile) { - acceptConnections(FALSE, portFile) + acceptConnections(4005, portFile) } acceptConnections <- function(port, portFile) { + if(portFile != FALSE) { + f <- file(portFile, open="w+") + cat(port, file=f) + close(f) + } s <- socketConnection(host="localhost", server=TRUE, port=port, open="r+b") on.exit(close(s)) serve(s)