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.
recv_vec(
socket,
mode = c("character", "complex", "double", "integer", "logical", "numeric", "raw"),
block = FALSE,
keep.raw = TRUE
)
a Socket.
[default 'character'] mode of vector to be read - one of 'character', 'complex', 'double', 'integer', 'logical', 'numeric', 'raw'.
[default FALSE] logical flag whether to block until successful or return immediately even if unsuccessful (e.g. nothing to receive).
[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.
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.