zeromq

ZeroMQ REQ/REP on ipc:// and concurrency

不问归期 提交于 2019-12-11 04:29:55
问题 I implemented a JSON-RPC server using a REQ/REP 0MQ ipc:// socket and I'm experiencing strange behavior which I suspect is due to the fact that the ipc:// underlying unix socket is not a real socket, but rather a single pipe. From the documentation, one has to enforce strict zmq_send()/zmq_recv() alternation, otherwise the out-of-order zmq_send() will return an error. However, I expected the enforcement to be per-client, not per-socket. Of course with a Unix socket there is just one pipeline

Exception in thread “main” java.lang.UnsatisfiedLinkError: no jzmq in java.library.path in Eclipse

心已入冬 提交于 2019-12-11 04:24:27
问题 Import org.zeromq.ZMQ; -For the above import statement, I am using "org folder" in jzmq master folder which consists of ZMQ.java file. -So, there is no problem with compilation. When I start running the program, It shows below exception Exception in thread "main" java.lang.UnsatisfiedLinkError: no jzmq in java.library.path at java.lang.ClassLoader.loadLibrary(Unknown Source) at java.lang.Runtime.loadLibrary0(Unknown Source) at java.lang.System.loadLibrary(Unknown Source) at org.zeromq.ZMQ.

PHP - An external Class/library is accessible from apache but not from phpunit

匆匆过客 提交于 2019-12-11 03:53:35
问题 I am using ZeroMQ socket library in my web application. I have configured php.ini so Apache can use ZMQ but I dont know how phpunit can use it. Dont phpunit use the same php.ini which apache uses? In phpunit I get following error. PHP Fatal error: Class 'ZMQContext' not found in /home/idlecool/checker/testcases/checkerTest.php on line 53 回答1: Which php.ini file is used for Apache and command-line generally depends on your Linux distribution ; if using Debian or Ubuntu, you'll generally have :

ZMQ latency with PUB-SUB (slow subscriber)

瘦欲@ 提交于 2019-12-11 03:43:26
问题 I have found a lot of question on a similar topic but they didn't help me to solve my problem. Using : Linux Ubuntu 14.04 python 3.4 zmq : 4.0.4 // pyZMQ 14.3.1 TL;DR Receiver queue in ZMQ SUB socket is growing indefinitely even after HWM are set. This happen when subscriber is slower than publisher. What can I do to prevent it ? Background I work in the human computer interaction filed. We have a huge code base to control the mouse cursor, this kind of things. I wanted to "break it" in

signal handler not working

房东的猫 提交于 2019-12-11 03:21:57
问题 I'm using czmq and zmq libraries in my code. I've registered a signal handler for SIGINT by calling signal in main. The code looks like this: #include "czmq.h" void sig_int(int signal); void* pub_handler(){ zctx_t *context = zctx_new (); void *publisher = zsocket_new (context, ZMQ_PUB); zsocket_connect (publisher, "tcp://localhost:5555"); sleep(1); char topic[20] = "REQ: speedlimit"; // while (true) { sleep( randof(10) ); zstr_sendm (publisher, topic); zstr_send (publisher, "driver analysis

inter thread comunication using ZeroMQ messages [closed]

大城市里の小女人 提交于 2019-12-11 03:05:20
问题 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 7 years ago . I am trying to use zeroMQ as a way to implement a messaging system between multiple threads. I tried the code below but it doesn't work; in the specific

setting the topic when using the pyobj subfunctions in zeromq/python

巧了我就是萌 提交于 2019-12-11 02:26:52
问题 This question was migrated from Server Fault because it can be answered on Stack Overflow. Migrated 5 years ago . I have been looking at zeromq and i noticed there were socket.send_pyobj() and socket.recv_pyobj() functions. My question is how would one set the topic for PUB/SUB if they called this. In the examples i have seen that have used the regular send it was always two strings with a space in between and first string would be considered a topic. topic = 'test' msg = 'hello' socket.send(

ZeroMQ: I want Publish–Subscribe to drop older messages in favor of newer ones

独自空忆成欢 提交于 2019-12-11 02:03:20
问题 I'm using ZeroMQ publish–subscribe sockets to connect two processes. The publishing process is a sensor, and has a much faster refresh rate than the subscription process. I want the subscription process to only use the most recent message in the queue — and ignore older messages altogether. I've tried setting a highwater mark on the subscriber, but that seems to drop newer messages rather than older. Is there a publish–subscribe pattern someone can direct me toward for this purpose? 回答1: read

ZeroMQ FiniteStateMachineException in REQ/REP pattern

六眼飞鱼酱① 提交于 2019-12-11 00:19:29
问题 I have two simple components which are supposed to communicate with each other using the REQ/REP ZeroMQ pattern. The Server (REP Socket) is implemented in Python using pyzmq: import zmq def launch_server(): print "Launching server" with zmq.Context.instance() as ctx: socket = ctx.socket(zmq.REP) socket.bind('tcp://127.0.0.1:5555') while True: msg = socket.recv() print "EOM\n\n" The Client (REQ socket) written in C# using the NetMQ library: using System; using System.Collections.Generic; using

Which ZeroMQ pattern is best of an asynchronous pair of sockets?

↘锁芯ラ 提交于 2019-12-10 23:29:16
问题 I have a server (running on Amazon) and a single client that connects to it. After a connect has been established the client and server exclusively communicate with each other and send messages. e.g. 1. Client -> Server 2. Client -> Server 3. Client <- Server 4. Client -> Server 5. Client <- Server 6. Client <- Server The client might lost connectivity and re-connect after some time and resume message sending. Also what are the implications of the order of messages? Could #2 arrive before #1?