zeromq

ZMQ Pub-Sub Program Failure When Losing Network Connectivity

安稳与你 提交于 2019-12-23 09:05:33
问题 I have a simple pub-sub setup on a mid-sized network, using ZMQ 2.1. Although some subscribers are using C# bindings, others are using Python bindings, and the issue I'm having is the same for either. If I pull the network cable from a machine running a subscriber, I get an un-catchable error that immediately terminates that subscriber. Here's a very simple example of a subscriber in Python (not actual production code, but enough to reproduce the problem): import zmq def main(server_address,

No messages match using SUB in Java with ZeroMQ

こ雲淡風輕ζ 提交于 2019-12-23 06:05:46
问题 I'm trying to use Java client with ZeroMQ. When subscribing to any prefix, the Java client matches no messages, although a similar Python client matches messages as expected. The Python server context = zmq.Context() socket = context.socket(zmq.PUB) socket.bind("tcp://*:5556") for i in range(100): r = "XXX " + i socket.send_string(r) time.sleep(random.randint(0,10)) The Python client working fine context = zmq.Context() socket = context.socket(zmq.SUB) socket.connect("tcp://localhost:5556")

Can I use ZeroMQ sockets to change communication mechanism between two microservices that use REST?

我的梦境 提交于 2019-12-23 05:28:10
问题 How can we transform cleanly a communication based on HTTP API --> to a message communication using ZMQ library ? 回答1: In case you indeed want to do so, one may design a kind of Mediator, using ZeroMQ tools. ZeroMQ has a set of multi-level abstractions, where AccessPoints, typically have a certain "behaviour" ( a distributed behaviour ) they perform among themselves. Your indicated target aims at using no such behaviour, but to have some sort of transparent, (almost) wire-level handling of

ZeroMQ - Emulating standard socket for multiple clients to one server

你说的曾经没有我的故事 提交于 2019-12-23 05:21:17
问题 I am hoping to utilise ZeroMQ in order to handle queuing of a large number of requests coming in at the same time to an attestation server. I am in an HPC environment and so have a large number of compute nodes all running the same launcher program that attests with a server. This server code runs on a front-end node and after successfully attesting the client, will then release a key in order for the client to decrypt job data. Currently standard sockets are used. When a client initially

How to receive data with ZeroMQ?

别等时光非礼了梦想. 提交于 2019-12-23 05:13:29
问题 I have a simple application which sends and receives data. ZSocketExample client = new ZSocketExample("127.0.0.1:5555"); client.send("test"); This is my client class: public class ZSocketExample:IDisposable { public delegate void ReceiveEventHandler(object sender, SocketEventArgs e); public event ReceiveEventHandler ReceiveEvent; private ZmqContext zmqContext; private ZmqSocket zmqSocket; private string host; private bool isRunning; private bool disposed = false; public ZSocketExample(string

Can reply be optional in ZeroMQ?

China☆狼群 提交于 2019-12-23 03:29:06
问题 I'm implementing a Lamport's distributed MUTEX algorithm in ZeroMQ. Algorithm : Requesting process 1 ) Pushing its request in its own queue (ordered by time stamps) 2 ) Sending a request to every node. 3 ) Waiting for replies from all other nodes. 4 ) If own request is at the head of its queue and all replies have been received, enter critical section. 5 ) Upon exiting the critical section, remove its request from the queue and send a release message to every process. Other processes 1 )

zeromq performance test. What's the accurate latency?

耗尽温柔 提交于 2019-12-23 02:47:07
问题 I'm using zmq to carry message across process, and I want to do some performance test to get the latency and throughout. The official site gives the guide to tell How to Run Performance Tests For example, I tried: local_lat tcp://*:15213 200 100000 remote_lat tcp://127.0.0.1:15213 200 100000 and get the result: message size: 200 [B] roundtrip count: 100000 average latency: 13.845 [us] But when trying the pub-sub example in C++, I found the time interval between sending and receiving is about

How to perform an On-the-Fly encoding of a stream of still-pictures (video) for sending these from C# to Python? [closed]

我只是一个虾纸丫 提交于 2019-12-23 02:01:59
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . I'm getting both Depth & Color frames from the Kinect 2, using the Kinect SDK ( C# ), and I'm sending them to Python clients using ZeroMQ . this.shorts = new ushort[ 217088]; // 512 * 424 this.depthBytes = new Byte[ 434176]; // 512 * 424 * 2 this.colorBytes = new Byte[4147200]; // 1920 * 1080 * 4 public void

ZeroMQ - how to make a CLIENT to give up and try at a later time if the SERVER doesn't respond?

情到浓时终转凉″ 提交于 2019-12-22 17:36:31
问题 Lets say I have a very simple Client/Server model, using REQ/REP from ZeroMQ. See python code below. In the code below the client will wait forever, but I want the client to give up (lets say after 20 seconds) and move on with its life if it doesn't get a response. The server could be down, the router unplugged, the WiFi is not working. I really don't or should care why. Then at a later time, I'll have the client try again and it could be a completely different request. But I fear I'll cross

How to send / receive binary data serialized with Protocol Buffers using ZMQ

断了今生、忘了曾经 提交于 2019-12-22 10:45:09
问题 I need to send an object (serialized with GPB) on a ZMQ socket. Currently the code have an extra copy. How do I directly write serialized array into message_t s data? ABT_CommunicationProtocol introPacket; // Fill the packet message_t introMessage; size_t dataLenght = introPacket.ByteSize(); char* temp = new char[dataLenght]; introPacket.SerializeToArray(temp, dataLenght); // write data to temp memcpy(introMessage.data(), temp, dataLenght); // copy data to message this->serverRquest.send