S3 generic to send an R object to a location that may be method-defined. Message objects encapsulate a payload along with an address, but other classes require a destination as the x argument, either through a FD class, or as a character hostname.

send(x, ...)
# S3 method for class 'Message'
send(x, header, payload=NULL, keep_conn=FALSE, ...)
# S3 method for class 'FD'
send(x, header, payload=NULL, keep_conn=FALSE, ...)
# S3 method for class 'character'
send(x, port, header, payload=NULL, keep_conn=FALSE, ...)

Arguments

x

Destination, or object encapsulating one, serving as S3 dispatch.

header

character header

payload

Object to send

keep_conn

Boolean flag to keep connection open

port

Integer port to bind to.

...

Passed on to further methods.

Value

Typically a File Descriptor of the connection if successful. -1L if connection is not kept.

See also

send, start

Examples

##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--  or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (x, ...) 
{
    stopifnot(ORCV_GLOBAL$STARTED)
    stopifnot(length(x) > 0)
    UseMethod("send", x)
  }
#> function (x, ...) 
#> {
#>     stopifnot(ORCV_GLOBAL$STARTED)
#>     stopifnot(length(x) > 0)
#>     UseMethod("send", x)
#> }
#> <environment: 0x5560301c1110>