send.socket(rzmq)
send.socket()所属R语言包:rzmq
send a message.
发送消息。
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Queue the message referenced by the msg argument to be sent to the socket referenced by the socket argument.
msg参数由引用队列的消息被发送到由插座参数引用的套接字。
A successful invocation of send.socket does not indicate that the message has been transmitted to the network, only that it has been queued on the socket and ZMQ has assumed responsibility for the message.
一个成功的的send.socket调用并不表明消息已被发送到网络,只知道它已经排队插槽上,ZMQ承担责任的消息。
用法----------Usage----------
send.socket(socket, data)
send.null.msg(socket)
参数----------Arguments----------
参数:socket
a zmq socket object
ZMQ插座对象
参数:data
the R object to be sent
要发送的R对象
值----------Value----------
a boolean indicating success or failure of the operation.
一个布尔值,指示成功或失败的操作。
(作者)----------Author(s)----------
ZMQ was written by Martin Sustrik <sustrik@250bpm.com> and Martin Lucina <mato@kotelna.sk>.
rzmq was written by Whit Armstrong.
参考文献----------References----------
http://www.zeromq.org http://api.zeromq.org http://zguide.zeromq.org/page:all
参见----------See Also----------
connect.socket,bind.socket,receive.socket,send.socket
connect.socket,bind.socket,receive.socket,send.socket
实例----------Examples----------
## remote execution server in rzmq[#远程执行服务器在rzmq]
library(rzmq)
context = init.context()
in.socket = init.socket(context,"ZMQ_PULL")
bind.socket(in.socket,"tcp://*:5557")
out.socket = init.socket(context,"ZMQ_PUSH")
bind.socket(out.socket,"tcp://*:5558")
while(1) {
msg = receive.socket(in.socket)
fun <- msg$fun
args <- msg$args
print(args)
ans <- do.call(fun,args)
send.socket(out.socket,ans)
}
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|