zeromq

How do I clear the buffer upon start/exit in ZMQ socket? (to prevent server from connecting with dead clients)

ぃ、小莉子 提交于 2019-12-07 06:58:21
问题 I am using a REQ/REP type socket for ZMQ communication in python. There are multiple clients that attempt to connect to one server. Timeouts have been added in the client script to prevent indefinite wait. The problem is that when the server is not running, and a client attempts to establish connection, it's message gets added to the queue buffer, which should not even exist at this moment ideally. When the script starts running and a new client connects, the previous client's data is taken

Follow up: Boost serialized custom C++ object passed over ZeroMQ pull socket

人盡茶涼 提交于 2019-12-07 06:33:29
问题 This is a follow up problem that I opened up earlier in another thread at Boost: De-serializing a custom C++ object passed over ZeroMQ pull socket. The problem in that thread has been resolved based on the answer provided. Now I have another problem at runtime. Please, see the below description. I am realtively new to C++ realm so I appreciate if you tell me any necessity for improvement in any part of the code provided in addition to what I descibed under problem statment. Description: I

0mq: pubsub latency continually growing with messages?

冷暖自知 提交于 2019-12-07 03:46:23
pub.py import zmq import random import sys import time port = "5556" if len(sys.argv) > 1: port = sys.argv[1] int(port) context = zmq.Context() socket = context.socket(zmq.PUB) socket.bind("tcp://*:%s" % port) topic = 10001 while True: msgdata = time.time() socket.send("%d %d" % (topic, msgdata)) print "topic:%d, msg:%.5f" % (topic, msgdata) time.sleep(1) sub.py import sys import zmq import time port = "5556" if len(sys.argv) > 1: port = sys.argv[1] int(port) if len(sys.argv) > 2: port1 = sys.argv[2] int(port1) # Socket to talk to server context = zmq.Context() socket = context.socket(zmq.SUB)

How should I handle multiple publishers on the same port on the same host?

自闭症网瘾萝莉.ら 提交于 2019-12-07 01:02:27
I am using the cluster module and in each of the worker processes I need to publish certain values out to a single server, which subscribes to each worker. I am using the zmq PUB socket in each worker process, but when each worker socket binds on the same port it causes a conflict and doesn't work. What socket pattern should I use so that I can publish/push/send values from my worker processes and subscribe to them with my server process? Reverse the pub-sub bind-connect. Sub binds and Pub connects solves the problem. 来源: https://stackoverflow.com/questions/24276128/how-should-i-handle

How to run ZeroMQ with Java?

旧时模样 提交于 2019-12-06 20:50:30
问题 I'm having an issue running ZeroMQ with Java using Eclipse and Windows XP. I've successfully installed [I think] the 0MQ libraries as well as the Java bindings. The instructions I used to do that are located here . Two files were built: zmq.jar and jzmq.dll . I placed the jar file in my project, which allowed the code to compile OK. I also set the java.library.path to the directory of the dll, added the perf directory to my project, and added libzmq.dll to my PATH. (All per the instructions).

工作日志,go get -v -x github.com/pebbe/zmq4 失败问题

被刻印的时光 ゝ 提交于 2019-12-06 19:22:26
工作日志,go get -v -x github.com/pebbe/zmq4 失败问题 笔者 因为工作需要使用ZeroMQ,但是在执行 go get -v -x github.com/pebbe/zmq4 命令时一直提示 auth.go:19:17: fatal error: zmq.h: No such file or directory 的错误,这里记录踩坑 日志 。 ZeroMQ简介 ZeroMQ(也称为ØMQ,0MQ或ZMQ)是一种高性能的异步消息传递库,旨在用于分布式或并行应用程序中。它提供了一个消息队列,但是与常见的RabbitMQ,ActiveMQ消息中间件不同。ZeroMQ就像一个工具包直接嵌入到项目中,具有很高的吞吐量。但也存在很多局限性。 ZeroMQ 优点 一)、吞吐量远高与其他消息中间件,号称是“史上最快的消息队列”。 二)、扩展性强,可以对原生的方法进行封装,丰富其功能。 ZeroMQ缺点 一)、消息的不可靠性。ZeroMQ并不能保证可靠的消息传输,算的上致命缺点吧。 二)、原生不支持消息的持久化,仅支持本地缓存。当本地缓存塞满后,可能存在消息丢失的情况。 三)、没有很好的调试工具。代码虽然提示发送成功,但订阅方却收不到消息。 解决思路 第一步:下载Windows版的zeromq,官网下载地址:https://dl.bintray.com/zeromq

Is it possible to run ZeroMQ on an Arduino

你。 提交于 2019-12-06 18:05:45
问题 I'm wondering, whether it is possible to communicate with an Arduino via ZeroMQ. I want to use the Arduino to control some equipment and want to have most of the application sit on a computer. For that it would be nice if the Arduino and the controller could communicate via zeromq and say a WiFi or Ethernet shield. Is that possible? In particular, is it in principle possible, given the current chips on the Arduino boards, and has anybody had success in that direction? 回答1: I don't think it

How to call MATLAB executable for Python on cluster?

老子叫甜甜 提交于 2019-12-06 15:55:08
I am using a python-matlab-bridge that calls MATLAB from python by starting it on a ZMQ socket. On my own computer, I hand the bridge the location of the executable (in this case MATLAB 2014B): executable='/Applications/MATLAB_R2014b.app/bin/matlab' and everything works as required and the printed statement is: Starting MATLAB on ZMQ socket ipc:///tmp/pymatbridge-49ce56ed-f5b4-43c4-8d53-8ae0cd30136d Now I want to do the same on a cluster. Through module avail I find there are two MATLAB versions (2015a and 2016b) available and located at the following path: /opt/ud/LOCAL/etc/modulefiles/matlab

How to Push data from C# to ZeroMQ and Pull from Node.JS or vice-versa?

限于喜欢 提交于 2019-12-06 15:54:08
Scenario : I am trying to send a data (say String type) from C# сonsole application to Node.JS server through ZeroMQ. Information: Using clrzmq for c# and ZeroMQ libs for C# and Node.JS respectively I am able to perform push-pull from Node.JS, also push - pull from C#. So, one thing is confirmed that ZeroMQ - The Intelligent Transport Layer is installed on the machine (Windows 7 64-bit) Issue : I am not able to push data from C# Console app to Node.JS app (even tried vice-versa), both are on the same machine and on the same address i.e tcp://127.0.0.1:2222 Node.js code: var zmq = require(

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

时光怂恿深爱的人放手 提交于 2019-12-06 15:44:17
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() # Waiting for script B to send done # ...................................................................