Running examples in ‘streamConnect-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: publish_DSD_via_WebService
> ### Title: Publish a Data Stream via a Web Service
> ### Aliases: publish_DSD_via_WebService
> 
> ### ** Examples
> 
> # find a free port
> port <- httpuv::randomPort()
> port
[1] 25421
> 
> # create a background DSD process sending data to the port
> rp1 <- publish_DSD_via_WebService("DSD_Gaussians(k = 3, d = 3)", port = port)
> rp1
PROCESS 'R', running, pid 70216.
> 
> # connect to the port and read manually. See DSD_ReadWebService for
> # a more convenient way to connect to the WebService in R.
> library("httr")

Attaching package: ‘httr’

The following object is masked from ‘package:stream’:

    write_stream

> 
> # we use RETRY to give the server time to spin up
> resp <- RETRY("GET", paste0("http://localhost:", port, "/info"))
Error in curl::curl_fetch_memory(url, handle = handle): Failed to connect to localhost port 25421 after 0 ms: Couldn't connect to server
Request failed [ERROR]. Retrying in 1 seconds...
Error in curl::curl_fetch_memory(url, handle = handle): Failed to connect to localhost port 25421 after 0 ms: Couldn't connect to server
Request failed [ERROR]. Retrying in 3.4 seconds...
> d <- content(resp, show_col_types = FALSE)
> d
# A tibble: 1 × 3
  description                         d     k
  <chr>                           <dbl> <dbl>
1 Gaussian Mixture (d = 3, k = 3)     3     3
> 
> # example: Get 100 points and plot them
> resp <- GET(paste0("http://localhost:", port, "/get_points?n=100"))
> d <- content(resp, show_col_types = FALSE)
> head(d)
# A tibble: 6 × 4
        X1    X2    X3 .class
     <dbl> <dbl> <dbl>  <dbl>
1  0.756   0.563 0.513      3
2  0.706   0.558 0.518      3
3  0.0552  0.609 0.400      2
4  0.706   0.754 0.144      1
5 -0.00719 0.603 0.355      2
6 -0.00444 0.599 0.399      2
> 
> dsd <- DSD_Memory(d)
> dsd
Memorized Stream 
Class: DSD_Memory, DSD_R, DSD 
Contains 100 data points - currently at position 1 - loop is FALSE 
> plot(dsd, n = -1)
> 
> # end the DSD process. Note: that closing the connection above
> # may already kill the process.
> rp1$kill()
[1] TRUE
> rp1
PROCESS 'R', finished.
> 
> # Publish using json
> 
> rp2 <- publish_DSD_via_WebService("DSD_Gaussians(k = 3, d = 3)", 
+            port = port, serializer = "json")
> rp2
PROCESS 'R', running, pid 73551.
> 
> # connect to the port and read
> # we use RETRY to give the server time to spin up
> resp <- RETRY("GET", paste0("http://localhost:", port, "/info"))
Error in curl::curl_fetch_memory(url, handle = handle): Failed to connect to localhost port 25421 after 0 ms: Couldn't connect to server
Request failed [ERROR]. Retrying in 1 seconds...
Error in curl::curl_fetch_memory(url, handle = handle): Failed to connect to localhost port 25421 after 0 ms: Couldn't connect to server
Request failed [ERROR]. Retrying in 2.6 seconds...
Error in curl::curl_fetch_memory(url, handle = handle) : 
  Failed to connect to localhost port 25421 after 0 ms: Couldn't connect to server
Calls: RETRY
Execution halted
Examples with CPU (user + system) or elapsed time > 5s
                            user system elapsed
DSC_WebService             4.014  0.284   9.014
publish_DSC_via_WebService 2.970  0.160   6.413
DSD_ReadWebService         2.884  0.234   6.561