Dear List,

 

i've tried to follow the little code example for having 2 R processes
communicating over 2 non-blocking sockets which is given at
'?socketConnection':

 

## Not run: 
## two R processes communicating via non-blocking sockets
# R process 1
con1 <- socketConnection(port = 6011, server=TRUE)
writeLines(LETTERS, con1)
close(con1)
 
# R process 2
con2 <- socketConnection(Sys.info()["nodename"], port = 6011)
# as non-blocking, may need to loop for input
readLines(con2)
while(isIncomplete(con2)) {Sys.sleep(1); readLines(con2)}
close(con2)

 

I've opened the respective ports in my Firewall(s) (tried it on two
machines: Windows XP/Windows 7; also checked various ports that were not yet
used by the system), yet my console freezes as soon as I assign 'con1'. Can
anyone tell me what I'm doing wrong? Does this only work on "non Rterm"
processes (RCMD, RScript)?

 

What I did find out yet is the following: Even though my console freezes in
process 1, when I open a new process and try to establish a connection to
the same port as in process 1, an error is thrown ("(.) port xxxx cannot be
opened"). So something must be happening in process 1. But I have no clue
where to look for the error as sockets/ports are unfortunately still pretty
new to me.

 

I'm using R 2.10.1.

 

Thanks a lot!

Janko

 


	[[alternative HTML version deleted]]

