public Subscriber() { router = UnityBuilder.Named("Subscriber") .WithTransport <NetMQTransport>(t => t.WithSubscriber(TcpAddress.Localhost(5556))) .Build(); throw new NotImplementedException(); //router.Subscribe<Observation>(AsyncHandler); }
public static void Run() { var router = UnityBuilder.Named("TestServer") .WithTransport <NetMQTransport>(t => t.WithReceiver(TcpAddress.Wildcard(5555))) .WithHandlers(h => h.WithAsyncRequestHandler <TestMessage, TestMessage>(Handler)) .BuildAndStart(); Console.WriteLine("Press enter to stop server"); Console.ReadLine(); router.Stop(); }
public static void Run() { Console.Write("Enter server name: "); var serverName = Console.ReadLine(); var router = UnityBuilder.Named("TestClient") .WithTransport <NetMQTransport>(t => { t.WithSender(TcpAddress.FromNameAndPort(serverName, 5555)).For <TestMessage>(); }) .BuildAndStart(); var client = new Client(router); client.Start(); }
public Publisher() { router = UnityBuilder.Named("Publisher") .WithTransport <NetMQTransport>(t => t.WithPublisher(TcpAddress.Wildcard(5556))) .Build(); }