zeromq

Reading Flatbuffers objects sent via ZMQ in C++ throws unhandled exception

痴心易碎 提交于 2019-12-05 06:45:50
问题 I am trying to send a reasonably big Flatbuffers object over the network via ZMQ and then read it using C++. When accessing the object, I get unhandled exceptions that I don't know how to solve. Even this minimal example fails: The flatbuffers schema: namespace flatbuffer; table TestBuf { testStatus:bool; testNumber:double; testInt:int; } root_type TestBuf; The main.cpp using the REP socket: int main() { zmq::context_t context(1); zmq::socket_t socket(context, ZMQ_REP); socket.bind("tcp://*

repl in webpage, best way to go about it?

送分小仙女□ 提交于 2019-12-05 06:39:33
问题 OK, so I am experimenting with a simple python repl in a browser. I want to put some python code in a text input, and then hit the 'send' button, then get back the result of evaluating it. I was using flask, with one route, which called the stdlib eval function, and then sends it back. I was also using zeroMQ with a simple server/client setup. I feel like I am missing something though... How is the standard way to go about doing this kind of thing? Projects like repl.it and skulpt are doing

Troubles with zmq_bind() in ZeroMQ binding for MQL4 language

拜拜、爱过 提交于 2019-12-05 06:14:57
问题 I am working on MT4 and used wrapper mql4zmq.dll as given in link https://github.com/AustenConrad/mql4zmq As I have followed all instruction and successfully loaded DLL as well as lib file at specific locations from pre-compiled. But it can not bind or connect with socket through zmq_connect(,) or zmq_bind(,) . Please some one help me to solve this problem. I am posting my code here // Include the libzmq.dll abstraction wrapper. #include <mql4zmq.mqh> //+--------------------------------------

消息队列mq总结

牧云@^-^@ 提交于 2019-12-05 02:52:34
一、消息队列概述 消息队列中间件是分布式系统中重要的组件,主要解决应用解耦,异步消息,流量削锋等问题,实现高性能,高可用,可伸缩和最终一致性架构。目前使用较多的消息队列有ActiveMQ,RabbitMQ,ZeroMQ,Kafka,MetaMQ,RocketMQ 二、消息队列应用场景 以下介绍消息队列在实际应用中常用的使用场景。异步处理,应用解耦,流量削锋和消息通讯四个场景。 2.1异步处理 场景说明:用户注册后,需要发注册邮件和注册短信。传统的做法有两种 1.串行的方式;2.并行方式 a、串行方式:将注册信息写入数据库成功后,发送注册邮件,再发送注册短信。以上三个任务全部完成后,返回给客户端。 b、并行方式:将注册信息写入数据库成功后,发送注册邮件的同时,发送注册短信。以上三个任务完成后,返回给客户端。与串行的差别是,并行的方式可以提高处理的时间 假设三个业务节点每个使用50毫秒钟,不考虑网络等其他开销,则串行方式的时间是150毫秒,并行的时间可能是100毫秒。 因为CPU在单位时间内处理的请求数是一定的,假设CPU1秒内吞吐量是100次。则串行方式1秒内CPU可处理的请求量是7次(1000/150)。并行方式处理的请求量是10次(1000/100) 小结:如以上案例描述,传统的方式系统的性能(并发量,吞吐量,响应时间)会有瓶颈。如何解决这个问题呢? 引入消息队列

Why does TCP/IP on Windows7 take 500 sends to warm-up? ( w10,w8 proved not to suffer )

 ̄綄美尐妖づ 提交于 2019-12-05 02:33:38
We are seeing a bizarre and unexplained phenomenon with ZeroMQ on Windows 7 , sending messages over TCP. ( Or over inproc , as ZeroMQ uses TCP internally for signalling, on Windows ). The phenomenon is that the first 500 messages arrive slower and slower, with latency rising steadily. Then latency drops and messages arrive consistently rapidly, except for spikes caused by CPU/network contention. The issue is described here: https://github.com/zeromq/libzmq/issues/1608 It is consistently 500 messages. If we send without a delay, then messages are batched so we see the phenomenon stretch over

ZMQ REP, knowing who send the request

不羁的心 提交于 2019-12-05 02:32:56
I m currently using zmq with python. Server is using REP socket. Do I have a way, when recv a message, to know who send it ? If a receive 2 messages, I just need to know if they come from the same user or not, so an uid for example would be enough. It looks like you want to implement async request handling on the server side: you let the server accept requests, process them asynchronously, and send the responses back to clients whenever the response data is available for each request. Now of course: how would you know, after you're done processing a request, which client to send it back to?

Is there any way to tell where a ZeroMQ message came from?

廉价感情. 提交于 2019-12-05 02:28:23
问题 I have a ZeroMQ socket that is receiving data from multiple processes on different machines. Without changing the contents of the data, is there any way to identify the source of the data? Specifically, I'd like the IP address of the sender if it came from a TCP connection. 回答1: No, there is no way to get the senders IP from the ZeroMq socket. That information is hidden within the implementation layers of ZeroMq. You have a couple of choices to handle solve this, one is to change the message

How to run ZeroMQ with Java?

♀尐吖头ヾ 提交于 2019-12-05 01:01:53
I'm having an issue running ZeroMQ with Java using Eclipse and Windows XP. I've successfully installed [I think] the 0MQ libraries as well as the Java bindings. The instructions I used to do that are located here . Two files were built: zmq.jar and jzmq.dll . I placed the jar file in my project, which allowed the code to compile OK. I also set the java.library.path to the directory of the dll, added the perf directory to my project, and added libzmq.dll to my PATH. (All per the instructions). I still get the following exception that I can't fix: Exception in thread "main" java.lang

Combining pub/sub with req/rep in zeromq

南笙酒味 提交于 2019-12-05 00:22:37
How can a client both subscribe and listen to replies with zeromq? That is, on the client side I'd like to run a loop which only receives messages and selectively sends requests, and on the server side I'd like to publish most of the time, but to sometimes receive requests as well. It looks like I'll have to have two different sockets - one for each mode of communication. Is it possible to avoid that and on the server side receive "request notifications" from the socket on a zeromq callback thread while pushing messages to the socket in my own thread? I am awfully new to ZeroMQ, so I'm not

ZeroMQ Usage of publish-Subscribe pattern in different networks, behind NAT/firewalls

家住魔仙堡 提交于 2019-12-04 21:32:55
Does Publish-Subscribe method work if: publisher and subscribers are in different networks (I've checked once - it works) subscribers are behind NAT\firewall In both cases packet routing works correctly. As I understand PUB\SUB uses the same TCP transport, so if PUB\SUB doesn't work so standard windows winsock doesn't work too? Is PUB\SUB proxy (like that http://zguide.zeromq.org/page:all#toc34 ) needed if packet routing mechanism is undefined only? I've found some code uses PUB\SUB model and works with NAT here http://grokbase.com/t/zeromq/zeromq-dev/112q9934vg/nat-firewall-pub-sub-traversal