public void DoTest(string topic, object data) { using (UdpBus bus = new UdpBus("224.0.0.23", 40001)) { object received = null; bus.Subscribe(topic, (o, e) => { System.Diagnostics.Debug.WriteLine(e.DataObject.ToString()); received = e.DataObject; Assert.AreEqual(data, received); }); bus.Start(); bus.Publish(topic, data, 3000); System.Threading.Thread.Sleep(3000); } }
public Communication(string ip, int port) { bus = new UdpBus(ip, port); bus.Subscribe(Topics.CenterQuery, OnCenterQuery); }