zeromq

Deadlock when synchronizing two simple python3 scripts using 0mq (ZeroMQ)

自闭症网瘾萝莉.ら 提交于 2019-12-08 04:18:56
问题 I get this strange deadlock when I try to synchronize two python3 scripts using 0mq ( ZeroMQ ). The scripts run fine for several thousand iterations, but sooner or later they both stop and wait for each other. I am running both scripts from different CMD-Windows on Windows 7. I cannot figure out why such a deadlock is even possible . What can go wrong here? Script A: while (1): context = zmq.Context() socket = context.socket(zmq.REP) socket.bind('tcp://127.0.0.1:10001') msg = socket.recv() #

Can ZeroMQ provide grounds for a bidirectional non-blocking asynchronous transmission?

醉酒当歌 提交于 2019-12-08 04:09:07
问题 I have a system which consists of two applications. Currently, two applications communicate using multiple ZeroMQ PUB/SUB patterns generated for each specific type of transmission. Sockets are programmed in C. For example, App X uses a SUB formal-socket archetype for receiving an information struct from App Y and uses another PUB formal-socket archetype for transmitting raw bit blocks to App Y and same applies to App Y . It uses PUB/SUB patterns for transmission and reception. To be clear App

using zmq::poll in multithreaded c++0x11 program in combination with cntr +x or kill signal

自闭症网瘾萝莉.ら 提交于 2019-12-08 04:00:01
问题 For a custom server I intent to use the int zmq::poll( zmq_pollitemt_t * items , int nitems, long timeout = -1) . function which is I think is a wrapper around the unix poll function but includes zmq::socket_t next to file descriptors. The function works as I expected until I press ctrl+x or run $kill my_server_pid in the terminal. I would expect that the poll to terminate with -1 or throws a zmq::error_t (which derives from std::exception ) which includes a errno and the strerr message. This

ZeroMQ: Packets being lost even after setting HWM and bufsize

房东的猫 提交于 2019-12-08 03:43:37
问题 We're using a PUSH/PULL Scalable Formal Communication Pattern in ZeroMQ. The sender application sends a total of 30,000 messages, 10kB each. There's a lot of data loss and hence we set the following on sender's side: zmq_socket = context.socket(zmq.PUSH) zmq_socket.setsockopt(zmq.SNDBUF, 10240) zmq_socket.setsockopt(zmq.SNDHWM, 1) zmq_socket.bind("tcp://127.0.0.1:4999") On receiver's side: zmq_socket = context.socket(zmq.PULL) zmqSocket.setReceiveBufferSize(10240); zmqSocket.setRcvHWM(1); zmq

Is There any way to achieve a ZeroMQ fullduplex channel?

风格不统一 提交于 2019-12-08 02:29:34
问题 The project is to build a messaging mechanism between a Python and C# program via ZeroMQ . I want messages to be able to travel in/out from both ends at any time, which is NOT a basic request-reply model a.k.a. REQ/REP . One way I can think of is to build a PUB/SUB model on two ports, i.e. two one way channels. Is there any method to get a real duplex channel? 回答1: There are several ways to do this with ZeroMQ. I suggest using a DEALER/ROUTER socket pair: Choose one program to be the "server"

ZeroMQ (clrzmq4) polling issue

删除回忆录丶 提交于 2019-12-08 01:59:41
问题 What I'm trying to accomplish is to implement reading a message from one of two sockets, wherever it arrives first. As far as I understand polling ( zmq_poll ) is the right thing to do (as demonstrated in mspoller in guide). Here I'll provide small pseudo-code snippet: TimeSpan timeout = TimeSpan.FromMilliseconds(50); using (var receiver1 = new ZSocket(ZContext.Current, ZSocketType.DEALER)) using (var receiver2 = new ZSocket(ZContext.Current, ZSocketType.PAIR)) { receiver1.Bind("tcp:/

Redis pubsub message queue but with callback, as in ZeroMQ

我的未来我决定 提交于 2019-12-08 01:31:58
问题 I have found the following code that implements an asynchronous message queue (actually there is no queue, only files) with ZeroMQ and Node.js setInterval(function() { var value = { id: i++, date: new Date() }; WriteFile(value.id + ".dat", value); client.send(value, function(result) { console.log(value, result); DeleteFile(value.id + ".dat"); }); }, 10000); The code is from here. The functions "WriteFile" and "DeleteFile" are defined later in the code, but there is nothing extraordinary there

No jzmq in java.library.path

半腔热情 提交于 2019-12-08 00:44:09
问题 I work on a trading engine where at the time of run, I get the log from the engine.log like the following, 2018_01_02_03_28_20_684 INFO ZMQCommunicatorService REMOTE_EXECUTOR_MARKET_ADMIN-ALL_MARKETS-0-5 - no jzmq in java.library.path, sleeping 2 minutes then try again 2018_01_02_03_28_20_697 INFO ZMQCommunicatorService ENGINE_MARKET_ADMIN-ALL_MARKETS-0-4 - Could not initialize class org.zeromq.ZMQ, sleeping 2 minutes then try again 2018_01_02_03_30_20_696 INFO ZMQCommunicatorService REMOTE

Is it possible to add an event handling to ZeroMQ to act when data is received/sent?

孤者浪人 提交于 2019-12-07 23:22:20
问题 I have created two unrelated daemon processes in C in Linux Ubuntu. These processes are in the sleeping mode, they only wake up when the data is received, and perform the action implemented in the signal handler and again sleep. I have implemented this communication using SIGNAL IPC and message queue. Before sending the message, I send the signal SIGUSR1 and then send the data, and I wrote the signal handler for SIGUSR1 to perform required action. I would like to implement the same way of

ZeroMQ pattern query

自作多情 提交于 2019-12-07 23:17:09
问题 I want to implement a server/client interaction in C++ using ZeroMQ (http://zeromq.org/). My requirement is to implement a function where if a client sends a request to the server, the server should send multiple pieces of data (in a sequence) back to the client. The client should be able to repeatedly send the request with the server replying with multiple pieces of data on each request. ZeroMQ prescribes models like req-res, pub-sub, push-pull, but this does not support my requirement