private static string SynchronizedSender(string input) { using (var context = ZmqContext.Create()) { using (ZmqSocket pub = Helper.GetConnectedPublishSocket(context, Pipe.PublishAddressClient), syncService = context.CreateSocket(SocketType.REP)) { //syncService.Connect(Pipe.PubSubControlFrontAddressClient); //for (int i = 0; i < 1; i++) //{ // syncService.Receive(Encoding.Unicode); // syncService.Send("", Encoding.Unicode); //} for (int i = 0; i < 100000; i++) { Console.WriteLine("Enter to send message=>"); input = Console.ReadLine(); if (input == "Exit") { break; } var cust = new Customer { Firstname = "John", Lastname = "Lemon" }; var pl = new Daytona.Store.DBPayload <Customer>(); pl.Payload = cust; ISerializer serializer = new Daytona.Store.Serializer(Encoding.Unicode); Helper.SendOneMessageOfType <Daytona.Store.DBPayload <Customer> >("Writer", pl, serializer, pub); // Helper.SendOneSimpleMessage("Writer", "Hello its me", pub); Console.WriteLine("message sent"); } Console.WriteLine("message sent enter to exit=>"); input = Console.ReadLine(); } } return(input); }
private static string SynchronizedSender(string input) { using (var context = ZmqContext.Create()) { using (ZmqSocket pub = Helper.GetConnectedPublishSocket(context, Pipe.PublishAddressClient), syncService = context.CreateSocket(SocketType.REP)) { //syncService.Connect(Pipe.PubSubControlFrontAddressClient); //for (int i = 0; i < 1; i++) //{ // syncService.Receive(Encoding.Unicode); // syncService.Send("", Encoding.Unicode); //} for (int i = 0; i < 100000; i++) { Console.WriteLine("Enter to send message=>"); input = Console.ReadLine(); if (input == "Exit") break; var cust = new Customer { Firstname = "John", Lastname = "Lemon" }; var pl = new Daytona.Store.DBPayload<Customer>(); pl.Payload = cust; ISerializer serializer = new Daytona.Store.Serializer(Encoding.Unicode); Helper.SendOneMessageOfType<Daytona.Store.DBPayload<Customer>>("Writer", pl, serializer, pub); // Helper.SendOneSimpleMessage("Writer", "Hello its me", pub); Console.WriteLine("message sent"); } Console.WriteLine("message sent enter to exit=>"); input = Console.ReadLine(); } } return input; }