zeromq

React/ZMQ/Ratchet - Websocket server response

让人想犯罪 __ 提交于 2019-12-02 10:18:52
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 do something with it when the push.php file is run (ran?): ... $push = $context->getSocket(ZMQ::SOCKET

How could I set hwm in the push/pull pattern of zmq?

余生颓废 提交于 2019-12-02 06:20:53
I have found a similar question, ZeroMQ: HWM on PUSH does not work , but it couldn't solve my problem. I want to control the number of messages that the push socket queues, but it doesn't work and still queues 1000 messages. So I want to know how to set the hwm of the push socket. Thanks in advance. My environment is: libzmq 4.0.4, pyzmq 14.1.0, python 3.3 Here's my code: server.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- import random import zmq class TestPush(object): def __init__(self): self.ctx = zmq.Context() random.seed() def run(self): task_snd = self.ctx.socket(zmq.PUSH) task_snd

Boost: De-serializing a custom C++ object passed over ZeroMQ pull socket

穿精又带淫゛_ 提交于 2019-12-02 05:58:47
The text I am writing here is a follow up problem that I opened up earlier in another thread at Boost: Serializing/De-serializing a custom C++ object passed over ZeroMQ pull socket . The compilation problems in the earlier thread have been resolved by using a textarchive type rather than binaryarchive but now I experience a runtime problem when de-serializing. I repeat the earlier text here with a new problem statement for your convenience. I am relatively new to C++ realm and appreciate any further help. Description: I have a C++ class named GenericMessage which simply holds an id and data as

How to implement Pub-Sub Network with a Proxy by using XPUB and XSUB in ZeroMQ(C++)?

点点圈 提交于 2019-12-02 03:03:06
问题 I am a newcomer to zeromq. Recently I did some tests on pub/sub of zeromq, and I don't konw how to implement Pub-Sub Network with a Proxy by using XPUB and XSUB in ZeroMQ. Hope your help, thank you very much . 回答1: Learn the basics by working through the examples. For the proxy, just use this, it's from msgqueue.cpp int main (int argc, char *argv[]) { zmq::context_t context(1); zmq::socket_t frontend (context, ZMQ_XSUB); frontend.bind("tcp://*:5559"); zmq::socket_t backend (context, ZMQ_XPUB)

Error installing ZeroMQ

左心房为你撑大大i 提交于 2019-12-02 02:52:11
问题 Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python2.7/dist-packages/zmq/__init__.py", line 51, in <module> from zmq import core, devices File "/usr/local/lib/python2.7/dist-packages/zmq/core/__init__.py", line 26, in <module> from zmq.core import (constants, error, message, context, ImportError: /usr/local/lib/python2.7/dist-packages/zmq/core/socket.so: undefined symbol: zmq_sendmsg I am getting above error. I have followed steps given on the

ZeroMQ学习:window下编译zeromq-3.2.3和jzmq-master

早过忘川 提交于 2019-12-02 00:19:21
最近发现公司项目中用的activemq队列总出现这样那样的问题,可能没有相关告诉解决,很是头疼。作为个人来说也很想寻找一款跨语言、高速的消息队列“玩一玩”,发现zeromq比较满足这个要求。 于是在oschina中看到相关的介绍(http://www.oschina.net/p/0mq),到相关网站下载了最新版本3.2.3各种安装包。首先安装ZeroMQ-3.2.3~miru2.3-x86这个,发现里面只有c接口,就目前来说可能不太符合我测试的要求,我首先需要的java接口的zeromq,在网上寻找了相关资料发现: zeromq (The ØMQ project) · GitHub 有很多语言支持包,需要下载后编译,目前我下载的是jzmq-master,是个实现是jni方式,当时也有纯java版的接口包,感兴趣的朋友可以试一试。 其实最主要的问题是zeromq和jzmq-master在window下的编译。最新版本的zeromq支持vs2010,刚好我机器上安装vs2010,但是jzmq-master没有,需要用vs2010打开后转换一下工程。 编译zeromq 解压zeromq.zip包,我存放的目录是:E:\c_project\,打开vs2010,导入项目(项目目录为E:\c_project\zeromq-3.2.3\builds\msvc),然后编译即可

Using ZeroMQ in Xamarin

眉间皱痕 提交于 2019-12-01 20:30:01
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? I fear there is no straightforward solution atm. Not until the NetMQ author will take all the way down to making the library portable. If you need a quick workaround you could try to make an

pyzmq installation error

非 Y 不嫁゛ 提交于 2019-12-01 14:00:14
I receive an error when trying to import zmq : Traceback (most recent call last): File "BasicPub.py", line 1, in <module> import zmq File "/home/przemek/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/zmq/__init__.py", line 66, in <module> from zmq import backend File "/home/przemek/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/zmq/backend/__init__.py", line 40, in <module> reraise(*exc_info) File "/home/przemek/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/zmq/backend/__init__.py", line 27, in <module> _ns = select_backend(first) File "/home/przemek/Enthought

pyzmq installation error

爱⌒轻易说出口 提交于 2019-12-01 13:07:40
问题 I receive an error when trying to import zmq : Traceback (most recent call last): File "BasicPub.py", line 1, in <module> import zmq File "/home/przemek/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/zmq/__init__.py", line 66, in <module> from zmq import backend File "/home/przemek/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/zmq/backend/__init__.py", line 40, in <module> reraise(*exc_info) File "/home/przemek/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/zmq

Python hangs up on returning from a function

一笑奈何 提交于 2019-12-01 08:57:39
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('routecall end') return ret When something_else runs, the following output is produced: routecall start