Learn R Programming

nanonext (version 0.7.3)

getopt: Get Option for a Socket, Context, Stream, Listener or Dialer

Description

Get value of opts for a Socket, Context, Stream, Listener or Dialer.

Usage

getopt(object, opt)

Value

The value of the option (logical for type 'bool', integer for 'int', 'duration' and 'size', character for 'string' and double for 'uint64').

Arguments

object

a Socket, Context, Stream, Listener or Dialer.

opt

name of option, e.g. 'reconnect-time-min', as a character string. See opts.

Details

To get options for a Listener or Dialer attached to a Socket or nano object, pass in the objects directly via for example $listener[[1]] for the first Listener.

Examples

Run this code
s <- socket("pair")
getopt(s, "send-buffer")
close(s)

s <- socket("req")
ctx <- context(s)
getopt(ctx, "send-timeout")
close(ctx)
close(s)

s <- socket("pair", dial = "inproc://nanonext", autostart = FALSE)
getopt(s$dialer[[1]], "reconnect-time-min")
close(s)

s <- socket("pair", listen = "inproc://nanonext", autostart = FALSE)
getopt(s$listener[[1]], "recv-size-max")
close(s)

Run the code above in your browser using DataLab