Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: e02858cdfc
Fetching contributors…

Cannot retrieve contributors at this time

38 lines (33 sloc) 1.162 kB
//
// Pubsub envelope publisher
//
// Author: Michael Compton, Tomas Roos
// Email: michael.compton@littleedge.co.uk, ptomasroos@gmail.com
using System.Text;
using System.Threading;
using ZMQ;
namespace ZMQGuide
{
internal class Program
{
public static void Main(string[] args)
{
using (var context = new Context(1))
{
using (Socket publisher = context.Socket(SocketType.PUB))
{
publisher.Bind("tcp://*:5563");
while (true)
{
// Write two messages, each with an envelope and content
publisher.SendMore("A", Encoding.Unicode);
publisher.Send("We don't want to see this.", Encoding.Unicode);
publisher.SendMore("B", Encoding.Unicode);
publisher.Send("We would like to see this.", Encoding.Unicode);
Thread.Sleep(1000); // avoid flooding the publisher
}
}
}
}
}
}
Jump to Line
Something went wrong with that request. Please try again.