The R Project SVN R

Rev

Rev 68948 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
42333 ripley 1
% File src/library/base/man/socketSelect.Rd
68948 ripley 2
% Part of the R package, https://www.R-project.org
77803 kalibera 3
% Copyright 1995-2020 R Core Team
42333 ripley 4
% Distributed under GPL 2 or later
5
 
26381 luke 6
\name{socketSelect}
56186 murdoch 7
\alias{socketSelect}
26381 luke 8
\title{Wait on Socket Connections}
9
\usage{
10
socketSelect(socklist, write = FALSE, timeout = NULL)
11
}
12
\arguments{
77803 kalibera 13
  \item{socklist}{list of open socket connections and server sockets.}
55555 ripley 14
  \item{write}{logical.  If \code{TRUE} wait for corresponding socket to
26381 luke 15
               become available for writing; otherwise wait for it to become
77803 kalibera 16
               available for reading or for accepting an incoming
17
               connection (server sockets).}
26381 luke 18
  \item{timeout}{numeric or \code{NULL}. Time in seconds to wait for a
19
                 socket to become available; \code{NULL} means wait
20
                 indefinitely.}
21
}
22
\description{
77803 kalibera 23
  Waits for the first of several socket connections and server sockets
24
  to become available.
26381 luke 25
}
26
\value{Logical the same length as \code{socklist} indicating
27
  whether the corresponding socket connection is available for
28
  output or input, depending on the corresponding value of \code{write}.
77803 kalibera 29
  Server sockets can only become available for input.
26381 luke 30
}
31
\details{
32
  The values in \code{write} are recycled if necessary to make up a
33
  logical vector the same length as \code{socklist}. Socket connections
34
  can appear more than once in \code{socklist}; this can be useful if
35
  you want to determine whether a socket is available for reading or
36
  writing.
37
}
38
\examples{
39
\dontrun{
40
## test whether socket connection s is available for writing or reading
61150 ripley 41
socketSelect(list(s, s), c(TRUE, FALSE), timeout = 0)
26381 luke 42
}
43
}
44
\keyword{connection}