NetMQ——推拉模式 Push-Pull
推送端
using (var pushSocket = new PushSocket("@tcp://127.0.0.1:1212")) { while (true) { //pushSocket.Connect(); string str = Console.ReadLine(); pushSocket.SendFrame(str); } }
拉取端
using (var receiver = new PullSocket(">tcp://127.0.0.1:1212")) //using (var sender = new PushSocket(">tcp://localhost:5558")) { //receiver. //process tasks forever while (true) { string workload = receiver.ReceiveFrameString(); Console.WriteLine(workload); } }