Learn R Programming

nanonext (version 0.2.0)

recv_vec: Receive Vector

Description

DEPRECATED [Use recv specifying mode] Receive vector data over a Socket. The counterpart to send_vec, data will be re-created from the raw vector according to the specified mode. Can be used when interfacing with external programs.

Usage

recv_vec(
  socket,
  mode = c("character", "complex", "double", "integer", "logical", "numeric", "raw"),
  block = FALSE,
  keep.raw = TRUE
)

Arguments

socket

a Socket.

mode

[default 'character'] mode of vector to be read - one of 'character', 'complex', 'double', 'integer', 'logical', 'numeric', 'raw'.

block

[default FALSE] logical flag whether to block until successful or return immediately even if unsuccessful (e.g. nothing to receive).

keep.raw

[default TRUE] TRUE to keep the received raw vector (useful for verification e.g. via hashing, or in case of an error in decoding to 'mode'). If FALSE, will return the decoded object only.

Value

Named list of 2 elements: 'raw' containing the received raw vector and 'data' containing the vector decoded to the type 'mode', or else the decoded vector of type 'mode' if keep.raw is set to FALSE.