| 42333 |
ripley |
1 |
% File src/library/base/man/socketSelect.Rd
|
| 68948 |
ripley |
2 |
% Part of the R package, https://www.R-project.org
|
| 59039 |
ripley |
3 |
% Copyright 1995-2007 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{
|
|
|
13 |
\item{socklist}{list of open socket connections}
|
| 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
|
|
|
16 |
available for reading.}
|
|
|
17 |
\item{timeout}{numeric or \code{NULL}. Time in seconds to wait for a
|
|
|
18 |
socket to become available; \code{NULL} means wait
|
|
|
19 |
indefinitely.}
|
|
|
20 |
}
|
|
|
21 |
\description{
|
| 61433 |
ripley |
22 |
Waits for the first of several socket connections to become available.
|
| 26381 |
luke |
23 |
}
|
|
|
24 |
\value{Logical the same length as \code{socklist} indicating
|
|
|
25 |
whether the corresponding socket connection is available for
|
|
|
26 |
output or input, depending on the corresponding value of \code{write}.
|
|
|
27 |
}
|
|
|
28 |
\details{
|
|
|
29 |
The values in \code{write} are recycled if necessary to make up a
|
|
|
30 |
logical vector the same length as \code{socklist}. Socket connections
|
|
|
31 |
can appear more than once in \code{socklist}; this can be useful if
|
|
|
32 |
you want to determine whether a socket is available for reading or
|
|
|
33 |
writing.
|
|
|
34 |
}
|
|
|
35 |
\examples{
|
|
|
36 |
\dontrun{
|
|
|
37 |
## test whether socket connection s is available for writing or reading
|
| 61150 |
ripley |
38 |
socketSelect(list(s, s), c(TRUE, FALSE), timeout = 0)
|
| 26381 |
luke |
39 |
}
|
|
|
40 |
}
|
|
|
41 |
\keyword{connection}
|