zeromq

How does ZeroMQ manage socket in zmq::proxy and zmq::poll?

混江龙づ霸主 提交于 2019-12-12 06:06:26
问题 I had a problem concerning ZeroMQ because I used pointer on a ZMQ socket for zmq::proxy and zmq::poll. Doing that occurs an exception with error 88 (Socket operation on non-socket). Actually ZeroMQ wants the user to send a structure cast in void* (source of the information) I did some research in the official documentation but I didn't found why ZeroMQ doesn't use a pointer on the socket. edit: This is the code I thought would be correct zmq::socket_t frontend_; zmq::socket_t backend_; zmq:

ZMQ getsocket method

感情迁移 提交于 2019-12-12 04:54:21
问题 What is the purpose of getSocket(type,persistence_id,callback) in zeromq? Will it create a new socket if one doesn't exist with the same persistence_id in the context? This is my client function newSocket(ZMQSocket $soc, $pid) { echo $pid; } $context = new ZMQContext(); $socket = $context->getSocket(ZMQ::SOCKET_PUSH, 'mysocket', 'newSocket'); $socket->setSockOpt(ZMQ::SOCKOPT_HWM,5); $socket->connect("tcp://172.16.136.59:5555"); for($i=0;$i<10;$i++) { var_dump($socket->send("hai",ZMQ::MODE

Cakephp 3: React/zmq library namespace

流过昼夜 提交于 2019-12-12 04:25:50
问题 I am working on on the basic tutorial on using ratchet mentioned here http://socketo.me/docs/push. I have created a test setup for the tutorial that works flawlessly. However, when I am trying to integrate the setup with CakePHP 3 I am running into problems. The ratchet and ZMQ servers are independent just the way mentioned in the tutorial. Only the following piece of code needs to move into CakePHP 3 controllers: $context = new ZMQContext(); $socket = $context->getSocket(ZMQ::SOCKET_PUSH,

Why is the ZMQ_RCVHWM option of ZeroMQ ineffective?

两盒软妹~` 提交于 2019-12-12 03:47:36
问题 There is an endpoint, which is Dealer, and an endpoint which is Router. The Dealer is connected to the Router by TCP protocol. I set ZMQ_SNDHWM and ZMQ_RCVHWM to 1 for all of them. Note that the Dealer always sends to Router, but the Router does not receive. The questions are: When the Router is not set up, the Dealer just sends one message and is then obstructed. That is right, because ZMQ_SNDHWM is 1. But when I setup the Router, the Dealer can continue send about 4K msg and obstructed. Why

How to understand the ZMQ_RCVHWM option of ZeroMQ correctly?

谁说胖子不能爱 提交于 2019-12-12 03:45:42
问题 There are two endpoints, which are Dealer and Router . The Dealer is connected to the Router by TCP protocol. I set ZMQ_SNDHWM and ZMQ_RCVHWM to only one for all of them. Note that the Dealer always sends message to Router, but the Router does not to do any receiving operation. When I only start the Dealer, the Dealer only send out one message.That`s expected. But when I start the Router after that, the Dealer can send out about 4 thousands message unexpectedly. why the ZMQ_RCVHWM option

ZeroMQ's EPGM not working in weather PUB-SUB demo

痞子三分冷 提交于 2019-12-12 03:25:08
问题 I have compiled libzmq with openpgm with no changes under windows. Code here is taken from ZeroMQ Guide ("weather publisher" server/client). But if i change "tcp" to "epgm" it doesn't work any more (data is not received, but connection is established). void test_serv() { // Prepare our context and publisher void *context = zmq_ctx_new(); void *publisher = zmq_socket(context, ZMQ_PUB); int rc = zmq_bind(publisher, "epgm://127.0.0.1:5556"); assert(rc == 0); // Initialize random number generator

How to get caller pid in zmq (local socket)

﹥>﹥吖頭↗ 提交于 2019-12-12 01:53:13
问题 Im new to zmq. Im using the same for local IPC in a Linux based OS (The socket is AF_UNIX type) But I could not find a way to get the caller's (client) process Id. Is there any way to find the same using zmq ? (Finding the pid of the caller is must for my access control requirement and if zmq does not provide the same then I should switch to dbus) Please help me. 回答1: Forget most of the low-level socket designs and worries. Think higher in the sky. ZeroMQ is a pretty higher-level messaging

why does jeromq use setReuseAddress(true)?

我只是一个虾纸丫 提交于 2019-12-11 19:16:15
问题 I'm new to zeromq and not that experienced with sockets. Are ZeroMQ sockets supposed to only allow one socket to bind() to a port? The jeromq implementation allows more than one; pyzmq does not. Who's correct? The jeromq ZMQ.Socket.bind() function eventually comes down to this: https://github.com/zeromq/jeromq/blob/master/src/main/java/zmq/TcpListener.java#L141 // Set address to listen on. public int set_address(final String addr_) { address.resolve(addr_, options.ipv4only > 0 ? true : false)

zeromq socket recv hanging

♀尐吖头ヾ 提交于 2019-12-11 14:12:43
问题 I use zeromq (latest version, 2012.04.04), c++, ms vs 2008 (x86 release/debug), windows 7 x64. I try to code simple client-server system. Problem My problem is dead hanging of the computer at recv() command on Windows 7, when many clients connect to the server at the same time . On Windows Vista the result is like on Windows XP - client has the fail: http://research.makseq.com/testZMQ/2.Vista.png http://research.makseq.com/testZMQ/1.PNG After this fail clients can not connect to the server,

Receiving 0 size messages while using ZMQ and protobuf

ぃ、小莉子 提交于 2019-12-11 13:15:17
问题 I am trying to set up a basic communication system between client and server using ZMQ. I am using protobuf for the message format. My problem is when I send the message from client the message size is 34 but the message size received on the server is 0. Following is my code; Client.cpp tutorial::Person person; person.set_id(1234); person.set_name("john"); person.set_email("john@mxyz.com"); person.set_phonenumber("12345678"); zmq::context_t context (1); // Prepare our context and socket zmq: