[R] Can't read from master socket connection?

jhallman@frb.gov jhallman at frb.gov
Fri Apr 8 20:49:15 CEST 2005


On mramx1.rsma.frb.gov, I create a master socket connection:
> server <- socketConnection(port = 11223, server = T, blocking = T, open = "a+")

This does not return until I connect with a client from another machine:
> client <- socketConnection("mramx1.rsma.frb.gov", port = 11223, open = "a+")

Now, back on the first machine, I do this
> writeLines(paste("line ", 1:3), server)

and on the client, 
> readLines(client)
[1] "line  1" "line  2" "line  3"

All well and good.  But if I try writing back from client to server, it
doesn't work.  Still on the client machine, I do this:
> writeLines(paste("line ", 1:4), client)

but back on the server, this hangs the R process
> readLines(server)   

I've also tried this with blocking = F on the server with the same result.
What am I missing?


Jeff




More information about the R-help mailing list