netmq

How to avoid disposing SubscriberSocket

拈花ヽ惹草 提交于 2020-01-07 08:11:01
问题 This implementation is bad since it will end up disposing the SubscriberSocket when the first subscription terminates. When I run it, nothing seems to publish. [This uses Rx 3.0.0] How to modify Receive function to fix this problem? using System; using System.Threading; using System.Threading.Tasks; using System.Collections.Generic; using NetMQ; using NetMQ.Sockets; using System.Reactive.Linq; namespace App1 { class MainClass { // publisher for testing, should be an external data publisher in

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

What is the proper way to wait for connections?

安稳与你 提交于 2019-12-21 10:45:09
问题 I am trying to implement a simple message passing between two applications using NetMQ (a slightly more elaborate description of what I am trying to achieve is below). After a bit of trial and error I've found that I can't just send or receive messages right away after a Connect/Bind calls, since they are non blocking and actually return even if the connection hasn't been established yet. For now I solved this with Thread.Sleep(), but this has a bad taste to it and definitely a no-go for a

How to identify the physical address of incoming connections in NetMQ?

百般思念 提交于 2019-12-13 12:22:23
问题 In the router-dealer example for NetMQ, we see that clients can set their own identity. This can be useful for logging purposes. However, what if I only control code for the server (router) and not the code for the clients (dealers)? What if some clients don't bother to set the identity in a way that is meaningful for my server? How do I include the physical address in my logs, when the client doesn't specifically give it to me in the message or identity? If you only know the answer based on

ZeroMQ FiniteStateMachineException in REQ/REP pattern

六眼飞鱼酱① 提交于 2019-12-11 00:19:29
问题 I have two simple components which are supposed to communicate with each other using the REQ/REP ZeroMQ pattern. The Server (REP Socket) is implemented in Python using pyzmq: import zmq def launch_server(): print "Launching server" with zmq.Context.instance() as ctx: socket = ctx.socket(zmq.REP) socket.bind('tcp://127.0.0.1:5555') while True: msg = socket.recv() print "EOM\n\n" The Client (REQ socket) written in C# using the NetMQ library: using System; using System.Collections.Generic; using

Zeromq which socket should bind on PubSub pattern

浪尽此生 提交于 2019-12-10 13:19:57
问题 I have been reading about ZeroMQ more specifically about NetMQ and almost every Pub/Sub examples I saw used to Bind the Publisher socket and then the Subscriber socket connects to the other. So i'm wondering if it is possible to do the reverse, i mean Bind the Subscriber socket and then publishers connect to it. Is this possible ? (I didn't found anything clear on documentation) What are the disadvantages using this connection strategy ? Any help will be usefull. 回答1: Yes, you can reverse it

How to identify the physical address of incoming connections in NetMQ?

混江龙づ霸主 提交于 2019-12-04 18:18:48
In the router-dealer example for NetMQ , we see that clients can set their own identity. This can be useful for logging purposes. However, what if I only control code for the server (router) and not the code for the clients (dealers)? What if some clients don't bother to set the identity in a way that is meaningful for my server? How do I include the physical address in my logs, when the client doesn't specifically give it to me in the message or identity? If you only know the answer based on some other implementation of ZeroMQ, I will be interested to hear it, but ultimately I want something

What is the proper way to wait for connections?

自古美人都是妖i 提交于 2019-12-04 04:48:39
I am trying to implement a simple message passing between two applications using NetMQ (a slightly more elaborate description of what I am trying to achieve is below). After a bit of trial and error I've found that I can't just send or receive messages right away after a Connect/Bind calls, since they are non blocking and actually return even if the connection hasn't been established yet. For now I solved this with Thread.Sleep(), but this has a bad taste to it and definitely a no-go for a production system. So the question is, how's one supposed to do it in NetMQ/ZeroMQ? Client example: using

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