zeromq

How does zmq poller work?

Deadly 提交于 2019-12-31 08:03:36
问题 I am confused as to what poller actually does in zmq. The zguide goes into it minimally, and only describes it as a way to read from multiple sockets. This is not a satisfying answer for me because it does not explain how to have timeout sockets. I know zeromq: how to prevent infinite wait? explains for push/pull, but not req/rep patterns, which is what I want to know how to use. What I am attempting to ask is: How does poller work, and how does its function apply to keeping track of sockets

React/ZMQ/Ratchet - Websocket server response

我与影子孤独终老i 提交于 2019-12-31 05:47:06
问题 I've currently got a web socket server running and working with Ratchet PHP. I'm not at the stage where I want external scripts to communicate with my server. I can successfully push data to it using ZMQ: push.php $json = ['name' => 'Joe Bloggs']; $context = new ZMQContext(); $socket = $context->getSocket(ZMQ::SOCKET_PUSH, 'Push Notification'); $socket->connect("tcp://localhost:5555"); $socket->send(json_encode($json)); Then in my webserver script I can send this to a method ( onNewPush ) to

zmq.hpp fails assertion when attempting to debug

风格不统一 提交于 2019-12-31 05:29:28
问题 Its been a while since I worked with c++ in visual studio, and due to this I can't tell when I am doing wrong when attempting to run a debug instance of zmq's hello world client. After installing zmq 4.0.3 and downloading the zmq.hpp master branch from github I copy/pasted the hello world client from the zmq guide. Using Visual Studio 2010 I navigated to the project properties and have included both the include folder containing zmq.h and the folder including zmq.hpp I also included the lib

Client maintenance in ZMQ ROUTER

佐手、 提交于 2019-12-31 03:56:09
问题 How does ZeroMQ ROUTER socket maintain its client connections internally. The guide says each client gets a unique-ID, but it is not clear on: What counts as a client (each machine a different client or each connected app different??) Is there a limit on the number of requests received from a client? The reason is, I am stress testing this code (from http://hintjens.com/blog:42) with ab: #include "czmq.h" int main(void) { zctx_t *ctx = zctx_new(); void *router = zsocket_new(ctx, ZMQ_ROUTER);

Using ZeroMQ in Xamarin

青春壹個敷衍的年華 提交于 2019-12-31 02:09:08
问题 I have an application composed from a server and a client. The Server is C/C++ application, and the client is a cross-platform Xamarin application that target Windows, Android and iOS . The Server part and the Client part communicate using ZeroMQ messages. I tried the current c# implementation like NetMQ and clrzmq, but they cannot be used in Xamarin. Did you know the simplest way to use ZeroMQ in Xamarin? 回答1: I fear there is no straightforward solution atm. Not until the NetMQ author will

Python hangs up on returning from a function

送分小仙女□ 提交于 2019-12-30 10:55:32
问题 So say I have two functions in a fairly complicated Flask application. One function calls the other function. def dispatch_unlock(...): # ... stuff ... log('dis start') # this routine just sends some data over a ZMQ IPC socket # in this scenario, the socket send will time out ret = acl.enqueue(unlock.id, endpoint_id, filter_entry['service_id']) log('dis end') return ret def something_else(...); # ... stuff ... log('routecall start') ret = dispatch_unlock(unlock, endpoint_id, endpoint, f) log(

Understanding ZeroMQ

為{幸葍}努か 提交于 2019-12-30 10:49:05
问题 So as I have asked in a previous post, I want to be able to make programs or functions written in different languages to communicate between them. I have come across zeromq recently and I'm trying to figure out whether or not this is something that could help me since it provides some sort of sockets. Can zeromq for example exchange data (or pass arguments) between a program written in python with a program or a function written in C++ or is its function for something completely different?

0MQ: How to use ZeroMQ in a threadsafe manner?

孤人 提交于 2019-12-29 14:28:48
问题 I read the ZeroMq guide and I stumbled upon the following: You MUST NOT share ØMQ sockets between threads. ØMQ sockets are not threadsafe. Technically it's possible to do this, but it demands semaphores, locks, or mutexes. This will make your application slow and fragile. The only place where it's remotely sane to share sockets between threads are in language bindings that need to do magic like garbage collection on sockets. and later on: Remember: Do not use or close sockets except in the

Does ZeroMQ have a notification/callback event/message for when data arrives?

不羁岁月 提交于 2019-12-29 08:09:09
问题 I am trying to integrate ZMQ into an existing windows application that relies heavily on MFC sockets (CASyncSocket). I've got a CWinThread derived UI thread (without a GUI) that communicates with a server asynchronously using CAsyncSocket. I would like to add a ZMQ inproc communication line to handle communicating the data received from the server (on a REQ/REP basis) to other threads within the application. Using CAsyncSocket, the OnReceive method is called by the MFC framework whenever new

Does ZeroMQ have a notification/callback event/message for when data arrives?

懵懂的女人 提交于 2019-12-29 08:08:21
问题 I am trying to integrate ZMQ into an existing windows application that relies heavily on MFC sockets (CASyncSocket). I've got a CWinThread derived UI thread (without a GUI) that communicates with a server asynchronously using CAsyncSocket. I would like to add a ZMQ inproc communication line to handle communicating the data received from the server (on a REQ/REP basis) to other threads within the application. Using CAsyncSocket, the OnReceive method is called by the MFC framework whenever new