How to gracefully terminate a socket server?
If I have a server function that is listening to a port in an infinite loop, how do I stop it? If i do ctrl+c it terminates the process and the program does not get a chance to destroy the socket...
View ArticleZMQ Dynamic Discovery with XPub-XSub
I'm attempting to implement dynamic discovery of networked "nodes" using ZMQ's XPub-XSub pattern. Every example I can find online is limited to a single machine - using localhost for the IP address....
View ArticleZeroMQ: How to prioritise sockets in a .poll() method?
Imagine the following code:import threading, zmq, timecontext = zmq.Context()receivers = []poller = zmq.Poller()def thread_fn(number: int): sender = context.socket(zmq.PUSH)...
View ArticleHow to configure Laravel Ratchet WebSocket + ZMQ host/port for local,...
I’m building a Laravel project that uses a WebSocket server with Ratchet and ZeroMQ (ZMQ) for broadcasting events.In my local environment, the setup looks like this://...
View ArticleHow to control the source IP address of a ZeroMQ packet on a machine with...
The Python standard library's socket.create_connection()method has a source address option, for controlling which source IP a connection uses. How do I do the same thing with a Python ZeroMQ socket,...
View Articleconfusing zmq termination race condition in whitepaper
I'm looking over this explanation of a race condition during the zmq termination procedure.Here is the relevant part from the page.In the following diagram we see a race condition where the main...
View ArticleCan't send a NumPy array larger than 2 GB with ZeroMQ
I'm using the Python code shown below to serialize and send a NumPy array from the client to the server using ZeroMQ. I noticed that when the NumPy array is larger than 2 GB the client seems to stall...
View ArticleCannot get MQL4 to connect with python via ZMQ
I'm trying to build an algorithmic trading bot. First step is to establish a connection between Python and MQL4 EA. I have the dir set up correctly. As shown below and my scripts are as follows. My...
View ArticleIs using MySQL and a socket message queue considered a realtime system?
I am using PHP and ratchet, I am dealing with how I can create an event from the server side and push it to the clients.I know I can use ZeroMQ, but this will also create an overhead, each time an...
View ArticleConflate PUSH-PULL Socket between NetMQ and ZeroMQ
I wanted to create a socket between a C# and a Python application and ZeroMQ seemed like a good implementation for this. I want to send data bidirectional and non-blocking, so for the prototype I...
View ArticleHow to publish one socket with multiple threads in ZeroMQ
I am using NetMQ, ZeroMQ's c# library, and I implemented it as follows.The problem here is that in the case of PublishAsync, multiple threads generate and invoke data from the outside.However, since...
View Articlepython zeromq Parallel Pipeline multiple consumers (workers)
Hello together!I would like to combine data from different python programs via zeromq. I think for that job the best solution would be parallel pipelines as are described in this example at the ponit...
View ArticleAutomatic reconnect in case of network failures
I am testing .NET version of ZeroMQ to understand how to handle network failures. I put the server (pub socket) to one external machine and debugging the client (sub socket). If I stop my local Wi-Fi...
View Articlehow to set zmq subscriber to buffer no msg
How to maker the zmq pub/sub subscriber buffers no msgs at all?import zmqimport timePUB_ADDR = "tcp://localhost:12345"ctx = zmq.Context()socket =...
View ArticleWhat is a good way to implement a barrier with ZeroMQ?
I have a barrier implementation, using a PAIR/PAIR interconnection.The server side will send a JSON-message to client and then wait for client sending a message. I will send 40000 messages in one test,...
View ArticleZmq for random recv and reply
I have two question regarding Zmq:-1) I am implementing a server which would receive 10K requests/per minute and then redirect these request towards backend. After getting response from backend it will...
View ArticleHow to reconnect zeromq client to server?
I have just started using the Python ZeroMQ library, pyzmq==27.1.0.I am running on a Raspberry Pi 5 (debian 12 - bookworm)I want to make sure my client reconnects if my server stops and restarts. When...
View ArticleMulti-threaded publish with zmq
I have a question as to the best way to publish from many threads to a single subscriber in ZMQ is. I have a web server, written in C++, that for each connection in, will need to send a ZMQ message to...
View ArticleHaving multiple sockets for same Context() and same port in ZMQ
My current system takes input stream from cameras, each camera in a separate instance, and apply Computer Vision models on each camera (Object Detection, Object Tracking and Personnel Recognition), and...
View ArticleHow to publish std::vector using zmq
I’m working on a ZeroMQ PUB/SUB setup where the publisher sends point cloud data captured from an Intel RealSense depth camera, and the subscriber reconstructs it for further processing.In my...
View ArticleBuilding ZeroMQ on Windows 10 with Visual Studio and / or CMake fails
I am trying to set up a Co-simulation between Matlab / Simulink and an external application using the ZeroMQ library. The example I would like to build upon is described here. Therefore I need a...
View Articleusing ZeroMQ with Electron 22 and Electron-Forge
I am trying to use ZeroMQ (0MQ) inside an Electron application: npm add zeromq@6.0.0-beta.19 and electron@22.3.24 and @electron-forge/cli@6.0.5On my local machine, for development, everything works as...
View Article0MQ - get message ip
A client is connecting himself to a server. The server should save the IP and do stuff with it later on (I really need the IP).I found this answer but I don't understand how I get the IP out of the...
View ArticleHow to make ZMQ pub client socket buffer messages while sub server socket is...
Given 2 applications whereapplication A is using a publisher client to contentiously stream data to application B which has a sub server socket to accept that data, how can we configure pub client...
View ArticleZeroMQ PUB-SUB communication : SUB receives nothing
I'm trying to get a PUB-SUB communication in ZeroMQ working where the PUB is in C++ and the SUB in python. I am using python 3.8, ZeroMQ 4.3.2, pyzmq 18.1.1 and cppzmq 4.5.0The PUB : int main() {...
View ArticleWhy a code, trying to read messages from two ZeroMQ sockets, fails?
I have issues with reading messages from two zmq servers (one set to REQ|REP and one PUB|SUB)The two servers are running on another computer. When I read just the REQ|REP connection everything works...
View ArticleFor how much time ZeroMQ (0MQ) server keeps state information of a client...
I am studying the message delivery guarantee in ZeroMQ, if it ensures exactly-once message delivery.The classic method is to keep the message number and client ID at the receiving node, and each time a...
View Articleshould a high performance trading engine save to DB synchronously?
For a high performance trading engine, it matches/handles one order at a time, should it save the order and other critical info to DB before it moves on to the next one?or can I use a separate thread...
View ArticleZeroMQ subscriber in Rails worker fails to receive messages
I am trying to subscribe to ZeroMQ from my Quake Live server. I registered the server on QLStats (green status here). However, my Rails 7.2.2.1 worker using ffi-rzmq 2.0.7 fails to receive messages. I...
View ArticleHow can I secure socket in NetMQ/ZeroMQ?
I'm using Router-Dealer and Pub-Sub patterns to send and receive messages using TCP(tcp://).The Server-Client communication is working fine and now I need to secure this socket connection over a...
View Article