Friday, May 3, 2013

ZeroMq, pub/sub mode tutorial , how-to

following the last post, it’s extremely easy to do a pub/sub empowering the zeromq.

IN C#, we setup one socket to pub type, and bind to one tcp port. IN the Node.js and Another C# client, we can create a socket with type Sub. then subscript the topics we are interested.

 image

then in the Node.js, create one special socket sub, and remember to call subscribe with the interested topic.


image

C# subscriber code,
image

Run the app, from c#, we can see message published and received,

image

from node.js client,
image

No comments:

 
Locations of visitors to this page