monitor {nanonext} | R Documentation |
Monitor a Socket for Pipe Changes
Description
This function monitors pipe additions and removals from a socket.
Usage
monitor(sock, cv)
read_monitor(x)
Arguments
sock |
a Socket. |
cv |
a conditionVariable. |
x |
an external pointer to a monitor. |
Value
For monitor
: a Monitor (object of class 'nanoMonitor').
For read_monitor
: an integer vector of pipe IDs (positive if added,
negative if removed), or else NULL if there were no changes since the
previous read.
Examples
cv <- cv()
s <- socket("poly")
s1 <- socket("poly")
m <- monitor(s, cv)
m
listen(s)
dial(s1)
cv_value(cv)
read_monitor(m)
close(s)
close(s1)
read_monitor(m)
[Package nanonext version 1.4.0 Index]