Ejemplo n.º 1
0
        public void Start()
        {
            try
            {
                _log.Info("Iniciando workers");

                _transmitter.Start();
                Thread.Sleep(50);
                _log.Info("Tx worker iniciado");
                _uiDispatcher.Start();
                Thread.Sleep(50);
                _log.Info("UI worker iniciado");
                _rxProcessor.Start();
                Thread.Sleep(50);
                _log.Info("Rx worker iniciado");

                _log.Info("Iniciando servicios");

                foreach (KeyValuePair<int, IReceiver> server in _serviceList)
                {
                    server.Value.IsAlive = true;
                    server.Value.Start();

                    Thread.Sleep(50);

                    _log.Info(string.Format("Servicio {0} iniciado correctamente", server.Value.Name));
                }

                _log.Info("CommServerManager iniciado correctamente");
            }
            catch (Exception ex)
            {
                _log.Error(ex);
            }
        }
Ejemplo n.º 2
0
        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();
        }
Ejemplo n.º 3
0
        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();
        }