zeromq

Differences between ZeroMQ and WebSockets

江枫思渺然 提交于 2020-01-19 02:38:46
问题 I'd like to know what the differences are between the ZeroMQ and WebSockets protocols . I know WebSockets was designed for web browser clients, but I'm assuming it can also be used server to server. And, in that case, I'm wondering if it would be good to use WebSockets instead of something else like ZeroMQ for real-time messaging . Specifically, I'm worried about reliability and missing messages in case of temporary network failure. 回答1: A: Real-Time-Messaging is a nice tag, however You may

what is the use of ZMQueue class in JeroMQ

我们两清 提交于 2020-01-17 06:18:12
问题 I checked source code of ZMQueue class from JeroMQ which implements Runnable interface looks like: private final Socket inSocket; private final Socket outSocket; public ZMQQueue( Context context, Socket inSocket, Socket outSocket ){ this.inSocket = inSocket; this.outSocket = outSocket; } @Override public void run(){ zmq.ZMQ.proxy( inSocket.base(), outSocket.base(), null ); } As you can see inside the run() only one statement is there, i.e. calling a ZMQ.proxy() - what happens here? And in

Storm workers not starting

自闭症网瘾萝莉.ら 提交于 2020-01-15 23:45:30
问题 My Nimbus host and supervisor run properly. When I submit a wordcount topology to the Nimbus host it successfully upload. After uploading topology supervisor giving error kill: No such process When I check the worker-6001.log and 6002.log I found a following error: 2014-02-09 17:20:05 b.s.m.TransportFactory [INFO] Storm peer transport plugin:backtype.storm.messaging.zmq 2014-02-09 17:20:05 b.s.d.worker [ERROR] Error on initialization of server mk-worker java.lang.UnsatisfiedLinkError: no jzmq

ZeroMQ handling interrupt in multithreaded application

会有一股神秘感。 提交于 2020-01-15 03:24:30
问题 Graceful exit in ZeroMQ in multithreaded environment Specs : ubuntu 16.04 with c++11,libzmq : 4.2.3 Sample code static int s_interrupted = 0; static void s_signal_handler (int signal_value) { s_interrupted = 1; //some code which will tell main thread to exit } static void s_catch_signals (void) { struct sigaction action; action.sa_handler = s_signal_handler; action.sa_flags = 0; sigemptyset (&action.sa_mask); sigaction (SIGINT, &action, NULL); sigaction (SIGTERM, &action, NULL); } static void

Does PyZMQ handle creating threads for each new client connection?

只谈情不闲聊 提交于 2020-01-14 13:24:45
问题 I'm using PyZMQ to create a request/reply server, and I'm trying to figure out if the act of creating a thread for each new client connection is handled by PyZMQ automatically. Ultimately, I'm trying to figure out if a request from one client that takes a long time to reply to will block requests from all other clients. Normally, I would call accept on a Python socket instance, block until a new connection is made, and handle any new connections in separate threads. However, PyZMQ sockets do

Does PyZMQ handle creating threads for each new client connection?

前提是你 提交于 2020-01-14 13:24:11
问题 I'm using PyZMQ to create a request/reply server, and I'm trying to figure out if the act of creating a thread for each new client connection is handled by PyZMQ automatically. Ultimately, I'm trying to figure out if a request from one client that takes a long time to reply to will block requests from all other clients. Normally, I would call accept on a Python socket instance, block until a new connection is made, and handle any new connections in separate threads. However, PyZMQ sockets do

Does PyZMQ handle creating threads for each new client connection?

风流意气都作罢 提交于 2020-01-14 13:24:07
问题 I'm using PyZMQ to create a request/reply server, and I'm trying to figure out if the act of creating a thread for each new client connection is handled by PyZMQ automatically. Ultimately, I'm trying to figure out if a request from one client that takes a long time to reply to will block requests from all other clients. Normally, I would call accept on a Python socket instance, block until a new connection is made, and handle any new connections in separate threads. However, PyZMQ sockets do

How to monitor whether a ZeroMQ server exists?

霸气de小男生 提交于 2020-01-14 03:29:10
问题 I want to check the existence ( state ) of a server before I send a ZeroMQ request, but I have no idea how to do it. 回答1: Q : I want to check the existence ( state ) of a server before I send a ZeroMQ request The solution is to setup and use the services of a zmq_socket_monitor() // Read one event off the monitor socket; return value and address // by reference, if not null, and event number by value. Returns -1 // in case of error. static int get_monitor_event ( void *monitor, int *value,

ZeroMQ: How to cast a pollitem_t item, used in Poller, back to a ZeroMQ socket?

风流意气都作罢 提交于 2020-01-14 03:28:07
问题 As title says, when using zmq::poll with cppzmq , I'd love to avoid hardcoding the translation of ZeroMQ sockets into pollitem_t item (s) for polling. But it seems that I'm not allowed to convert a void* pollitem_t::socket back to a zmq socket. I noticed that the official sample code just hardcoded the socket after polling. // // Reading from multiple sockets in C++ // This version uses zmq_poll() // // Olivier Chamoux <olivier.chamoux@fr.thalesgroup.com> #include "zhelpers.hpp" int main (int

Pulling requests from multiple clients with ZMQ

ぐ巨炮叔叔 提交于 2020-01-13 18:07:05
问题 I have a couple of workers waiting to do some jobs. I see that in the PULL/PUSH pattern I need to give the workers the ip address (using the tcp protocol) of the client, so it can listen to requests from there. However, in my case I want to have a lot of clients as well, coming from different IPs with requests... So basically I dont really have a static IP to bind the worker to PULL from. Am I using the wrong pattern or is there a way to do it correctly? 回答1: You should consider using the