File: b1_sendrecvfile.Rd

package info (click to toggle)
r-cran-pbdzmq 0.3.3%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 800 kB
  • sloc: ansic: 675; sh: 93; pascal: 30; makefile: 4
file content (66 lines) | stat: -rw-r--r-- 1,791 bytes parent folder | download
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/R_zmq_transfer.r
\name{File Transfer Functions}
\alias{File Transfer Functions}
\alias{zmq.sendfile}
\alias{zmq.recvfile}
\title{File Transfer Functions}
\usage{
zmq.sendfile(port, filename, verbose = FALSE, flags = .pbd_env$ZMQ.SR$BLOCK)

zmq.recvfile(port, endpoint, filename, verbose = FALSE,
  flags = .pbd_env$ZMQ.SR$BLOCK)
}
\arguments{
\item{port}{A valid tcp port.}

\item{filename}{The name (as a string) of the in/out files.}

\item{verbose}{logical; determines if a progress bar should be shown.}

\item{flags}{a flag for the method used by \code{zmq_sendfile} and
\code{zmq_recvfile}}

\item{endpoint}{A ZMQ socket endpoint.}
}
\value{
\code{zmq.sendfile()} and \code{zmq.recvfile()} return
number of bytes (invisible) in the sent message if successful,
otherwise returns -1 (invisible) and sets \code{errno} to the error
value, see ZeroMQ manual for details.
}
\description{
High level functions calling \code{zmq_send()} and \code{zmq_recv()}
to transfer a file in 200 KiB chunks.
}
\details{
\code{zmq.sendfile()} binds a \code{ZMQ_PUSH} socket, and 
\code{zmq.recvfile()} connects to this with a \code{ZMQ_PULL} socket.
}
\examples{
\dontrun{
### Run the sender and receiver code in separate R sessions.

# Receiver
library(pbdZMQ, quietly = TRUE)
zmq.recvfile(55555, "localhost", "/tmp/outfile", verbose=TRUE)

# Sender
library(pbdZMQ, quietly = TRUE)
zmq.sendfile(55555, "/tmp/infile", verbose=TRUE)
}

}
\references{
ZeroMQ/4.1.0 API Reference:
\url{http://api.zeromq.org/4-1:_start}

Programming with Big Data in R Website: \url{http://r-pbd.org/}
}
\seealso{
\code{\link{zmq.msg.send}()}, \code{\link{zmq.msg.recv}()}.
}
\author{
Drew Schmidt and Christian Heckendorf
}
\keyword{programming}