forked from shikokuchuo/nanonext
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstream.Rd
50 lines (44 loc) · 1.76 KB
/
stream.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/stream.R
\name{stream}
\alias{stream}
\title{Open Stream}
\usage{
stream(dial = NULL, listen = NULL, textframes = FALSE, tls = NULL)
}
\arguments{
\item{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).}
\item{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).}
\item{textframes}{[default FALSE] applicable to the websocket transport only,
enables sending and receiving of TEXT frames (ignored otherwise).}
\item{tls}{(optional) applicable to secure websockets only, a client or
server TLS configuration object created by \code{\link{tls_config}}. If
missing or NULL, certificates are not validated.}
}
\value{
A Stream (object of class 'nanoStream' and 'nano').
}
\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.
}
\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.
Can be used to dial a (secure) websocket address starting 'ws://' or
'wss://'. It is often the case that 'textframes' needs to be set to TRUE.
Specify only one of 'dial' or 'listen'. If both are specified, 'listen'
will be ignored.
}
\examples{
# will succeed only if there is an open connection at the address:
s <- tryCatch(stream(dial = "tcp://127.0.0.1:5555"), error = identity)
s
}