// Collection of code snippets by Arne Vajhøj // (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) using System; using NetMQ; using NetMQ.Sockets; public class Cli { private const string TOPIC = "1234"; private static void Test(string addr) { using (SubscriberSocket s = new SubscriberSocket()) { s.Connect(addr); s.Subscribe(TOPIC); for(int i = 0; i < 3; i++) { string respmsg = s.ReceiveFrameString(); respmsg = respmsg.Substring(TOPIC.Length + 1); Console.WriteLine("C# Client : " + respmsg); } } } public static void Main(string[] args) { Test("tcp://localhost:10001"); Test("tcp://localhost:10002"); Test("tcp://localhost:10003"); Test("tcp://localhost:10004"); Test("tcp://localhost:10005"); Test("tcp://localhost:10006"); } }