
134 R Programming for Bioinformatics
writeLines(LETTERS, serverCon)
close(serverCon)
Then, the second R process opens a connection to the same port but, this
time, in client mode. Since the client mode is not blocking, we must poll
until we have a complete input. The call to Sys.sleep ensures that some time
elapses between calls to readLines and allows other processes to be run.
clientCon = socketConnection(port = 6534)
readLines(clientCon)
while(isIncomplete(clientCon)) {
Sys.sleep(1)
readLines(clientCon)}
close(clientCon)
Unfortunately, connections are not exposed at the C level so there is no
opp ortunity for accessing them directly at that level.
4.3.2.2 ...