Free Access Week-  Data Engineering + BI
Data engineering and BI courses are free!
Free AI Access Week from June 2-8

nanonext (version 0.4.0)

stream: Open Stream

Description

Open a Stream by either dialing (establishing an outgoing connection) or listening (accepting an incoming connection) at an address. This is a low-level interface intended for communicating with non-NNG endpoints.

Usage

stream(dial = NULL, listen = NULL, textframes = FALSE)

Arguments

dial

a URL to dial, specifying the transport and address as a character string e.g. 'ipc:///tmp/anyvalue' or 'tcp://127.0.0.1:5555' (not all transports are supported).

listen

a URL to listen at, specifying the transport and address as a character string e.g. 'ipc:///tmp/anyvalue' or 'tcp://127.0.0.1:5555' (not all transports are supported).

textframes

[default FALSE] applicable to the websocket transport only, enables sending and receiving of TEXT frames (ignored otherwise).

Value

A Stream (object of class 'nanoStream' and 'nano').

Details

A Stream is used for raw byte stream connections. Byte streams are reliable in that data will not be delivered out of order, or with portions missing.

Specify only one of 'dial' or 'listen'. If both are specified, 'listen' will be ignored.

TLS is automatically configured for dialing a secure websocket address starting 'wss://' (where the NNG library has been built with TLS support).

Examples

Run this code
# NOT RUN {
# will succeed only if there is an open connection at the address:
s <- stream(dial = "tcp://127.0.0.1:5555")

# }

Run the code above in your browser using DataLab