public void Stop() { foreach (KeyValuePair<int, IReceiver> service in _serviceList) { service.Value.Stop(); _log.Info(string.Format("Servicio {0} detenido correctamente", service.Value.Name)); } _rxProcessor.Stop(); _transmitter.Stop(); _uiDispatcher.Stop(); }
public static void Main(string[] args) { Dictionary <DemoType, Type> transmitters = new Dictionary <DemoType, Type>() { { DemoType.Udp, typeof(UdpTransmitter) }, { DemoType.Tcp, typeof(TcpTransmitter) }, { DemoType.Multicast, typeof(MulticastTransmitter) } }; DemoType demoType = GetDemoType(); ITransmitter transmitter = Activator.CreateInstance(transmitters[demoType]) as ITransmitter; OscBundle bundle = CreateTestBundle(); transmitter.Start(bundle); // Stop the transmitter, and exit, when a key is pressed. Console.ReadKey(); transmitter.Stop(); }
public static void Main(string[] args) { Dictionary <DemoType, Type> transmitters = new Dictionary <DemoType, Type>() { { DemoType.Udp, typeof(UdpTransmitter) }, { DemoType.Tcp, typeof(TcpTransmitter) }, { DemoType.Multicast, typeof(MulticastTransmitter) } }; DemoType demoType = GetDemoType(); ITransmitter transmitter = Activator.CreateInstance(transmitters[demoType]) as ITransmitter; //OscBundle bundle = CreateTestBundle(); //transmitter.Start(bundle); IPEndPoint sourceEndPoint = new IPEndPoint(Program.ipAddress, Properties.Settings.Default.Port); OscMessage labelMessage = new OscMessage(sourceEndPoint, LabelMethod, "Hello"); transmitter.Start(labelMessage); // Stop the transmitter, and exit, when a key is pressed. Console.ReadKey(); transmitter.Stop(); }