pub <- socket("pub", dial = "inproc://nanonext")
send(pub, data.frame(a = 1, b = 2))
send(pub, c(10.1, 20.2, 30.3), mode = "raw", block = 100)
close(pub)
req <- socket("req", listen = "inproc://nanonext")
rep <- socket("rep", dial = "inproc://nanonext")
ctx <- context(req)
send(ctx, data.frame(a = 1, b = 2), block = 100)
msg <- recv_aio(rep, timeout = 100)
send(ctx, c(1.1, 2.2, 3.3), mode = "raw", block = 100)
close(req)
close(rep)
Run the code above in your browser using DataLab