Skip to contents

An alternative to close for Sockets, Contexts, Listeners, Dialers and Pipes avoiding S3 method dispatch.

Usage

reap(con)

Arguments

con

a Socket, Context, Listener, Dialer or Pipe.

Value

An integer exit code (zero on success).

Details

May be used on unclassed external pointers e.g. those created by .context. Returns silently and does not warn or error, nor does it update the state of object attributes.

See also

Examples

s <- socket("req")
listen(s)
dial(s)
ctx <- .context(s)

reap(ctx)
#> [1] 0
reap(s[["dialer"]][[1]])
#> [1] 0
reap(s[["listener"]][[1]])
#> [1] 0
reap(s)
#> [1] 0
reap(s)
#> 'errorValue' int 7 | Object closed