

   RReeaadd ffrroomm oorr wwrriittee ttoo aa ssoocckkeett

        read.socket(socket, maxlen=256, loop=FALSE)
        write.socket(socket, string)

   AArrgguummeennttss::

     socket: a socket object

     maxlen: maximum length of string to read

       loop: wait for ever if there is nothing to read?

     string: string to write to socket

   DDeessccrriippttiioonn::

        `read.socket' reads a string from the specified socket,
        `write.socket' writes to the specified socket.  There
        is very little error checking done by either.

   VVaalluuee::

        `read.socket' returns the string read.

   AAuutthhoorr((ss))::

        Thomas Lumley

   SSeeee AAllssoo::

        `close.socket', `make.socket'

   EExxaammpplleess::

        finger <- function(user, host = "localhost", port = 79, print = TRUE)
        {
            if (!is.character(user))
                stop("user name m\uns"t) be a string")
            user <- paste(user,"
            socket <- make.socket(host, port)
            on.exit(close.socket(socket))
            write.socket(socket, user)
            output <- character(0)
            repeat{
                ss <- read.socket(socket)
                if (ss == "") break
                output <- paste(output, ss)
            }
            close.socket(socket)
            if (print) cat(output)
            invisible(output)
        }
        finger("root")  ## only works if your site provides a finger daemon

