zeromq

Can I pass a file descriptor over a 0mq (zeromq) ipc socket?

帅比萌擦擦* 提交于 2019-12-13 15:38:22
问题 I have a master process and several workers, communicating using 0mq 'ipc://' sockets (UNIX domain sockets). I want to pass a file descriptor from the master to a worker, along with a message. I know that 'raw' UNIX domain sockets can be used to pass a file descriptor from one process to another, but can I do it with my zeromq sockets? I don't care about portability, and frankly I don't care if its a slightly dirty solution. Is there any way? Thanks in advance. 回答1: Hackiest method would be

ZeroMQ PUB/SUB with epgm not able to receive messages sent by process on the same host

我怕爱的太早我们不能终老 提交于 2019-12-13 14:52:04
问题 All my processes have two sockets, one PUB and one SUB, and they all use the same multicast address and port. For example, PUB will do this: bind("epgm://239.192.1.1:5555") SUB will do this: connect("epgm://239.192.1.1:5555") setsockopt(ZMQ_SUBSCRIBE, "", 0); //subscribe everything PUB will then send message by calling zmq_send, and SUB will receive by calling zmq_poll and do Nonblocking zmq_recv. It works perfectly fine when I run two processes on two different hosts. But if I run them on

How to identify the physical address of incoming connections in NetMQ?

百般思念 提交于 2019-12-13 12:22:23
问题 In the router-dealer example for NetMQ, we see that clients can set their own identity. This can be useful for logging purposes. However, what if I only control code for the server (router) and not the code for the clients (dealers)? What if some clients don't bother to set the identity in a way that is meaningful for my server? How do I include the physical address in my logs, when the client doesn't specifically give it to me in the message or identity? If you only know the answer based on

STORM ERROR java.lang.UnsatisfiedLinkError?

坚强是说给别人听的谎言 提交于 2019-12-13 12:21:39
问题 Compile no problem, but after run..... 26183 [Thread-34] ERROR backtype.storm.util - Async loop died! java.lang.UnsatisfiedLinkError: org.zeromq.ZMQ$Socket.finalize()V at org.zeromq.ZMQ$Socket.finalize(Native Method) at org.zeromq.ZMQ$Socket.close(ZMQ.java:339) at storm.starter.spout.RandomSentenceSpout.nextTuple(RandomSentenceSpout.java:56) at backtype.storm.daemon.executor$fn__3985$fn__3997$fn__4026.invoke(executor.clj:502) at backtype.storm.util$async_loop$fn__465.invoke(util.clj:377) at

How can I use send_json with pyzmq PUB SUB

…衆ロ難τιáo~ 提交于 2019-12-13 12:20:45
问题 I need to send a dictionary as the message from a publisher to subscribers. With the REQ/REP pattern send_json and recv_json work nicely, but I can't seem to find an incantation that works for PUB/SUB. Hope it's not the case that PUB/SUB can only work with send() and recv(). Here's the listing for the experiment I put together: """ Experiments with 0MQ PUB/SUB pattern """ import os import sys import time import zmq from multiprocessing import Process from random import sample, choice import

ZMQError: Cannot assign requested address

无人久伴 提交于 2019-12-13 12:12:19
问题 I'm using zeromq to develop a dynamic application which operate like upnp protocol( autoconfiguration and auto-discovery of equipment on a living room). To do it so, i use zeromq to distribute messages, my problem is that when i create a socket and binding on a adress "169.254.1.0 through 169.254.254.255" , I receive a error messages like this: ZMQError: Cannot assign requested address . I've tried to figure out why by changing the address by local adress (127.0.0.1),and it's works !!. The

Implementing a message bus using ZeroMQ

我们两清 提交于 2019-12-13 11:39:50
问题 I have to develop a message bus for processes to send, receive messages from each other. Currently, we are running on Linux with the view of porting to other platforms later. For this, I am using ZeroMQ over TCP. The pattern is PUB-SUB with a forwarder. My bus runs as a separate process and all clients connect to SUB port to receive messages and PUB to send messages. Each process subscribes to messages by a unique tag. A send call from a process sends messages to all. A receive call will

converting array of binary doubles in protocol buffer to javascript numbers

匆匆过客 提交于 2019-12-13 07:23:56
问题 I'm using protocol buffers over zeroMQ to send graph data from C++ to a Javascript frontend: message RawData { Type type = 1; bytes data = 2; } when i call RawData.getData() i get something like this (usually much longer): Data: 0, 0, 0, 0, 0, 0, 0, 0, 64, 1, 118, 62, 112, 8, 12, 63 This is two 8 bytes numbers, where each index in the array is 1 byte. How do I convert this into double representation in Javascript? EDIT: i ended up changing the protocol buffer message to repeated double data =

cannot pass by reference to thread

好久不见. 提交于 2019-12-13 03:36:02
问题 I am trying to pass by reference to a thread, a variable defined as: zmq::context_t context(1); like this: t[thread_nbr] = std::thread(worker_routine, (void *)&context, trained_images); However, when I do I get the following error: /usr/include/c++/5/functional:1505:61: error: no type named ‘type’ in ‘class std::result_of<void* (*(void*, std::vector<TrainedImage>))(void*, std::vector<TrainedImage>&)>’ typedef typename result_of<_Callable(_Args...)>::type result_type; ^ /usr/include/c++/5

ZeroMQ epgm error on Linux: Protocol not supported

风流意气都作罢 提交于 2019-12-12 22:17:27
问题 I'm trying to multicast using zmq on Linux. My program dies on the line that tries to bind to the epgm address. I ran the exact same code in VC++ while i was running the client and server both on the same host and it ran fine. However from what i've read by other programmers on this site, zmq does not support loopback functionality so I can't do publishes and receive the messages on the same host using epgm. I moved the program to a linux box and I received an error. Here are the code and the