Esempio n. 1
0
 static void Main(string[] args)
 {
     ConfigureService.Configure();
 }
Esempio n. 2
0
        static void Main(string[] args)
        {
            var cfg = JsonConvert.DeserializeObject <Config>(File.ReadAllText("settings.json"));

            ConfigureService.Configure(cfg);
        }
 static void Main(string[] args)
 {
     //Call there configure service class.s
     ConfigureService.Configure();
 }
Esempio n. 4
0
        static void Main(string[] args)
        {
            // This will *ONLY* bind to localhost, if you want to bind to all addresses
            // use http://*:8080 to bind to all addresses.
            // See http://msdn.microsoft.com/en-us/library/system.net.httplistener.aspx
            // for more information.
            // string url = "http://localhost:8085";
            // string url = "http://192.168.151.87:18274/";

            var option = new StartOptions();

            //option.Urls.Add("http://localhost:18275");
            // You can either get dynamic ip OR set in app.config
            // But for demo purpose i have set it static
            option.Urls.Add("http://192.168.43.33:18276");
            // SignalR = WebApp.Start(option);

            WebApp.Start(option);



            IHubContext hubContext = GlobalHost.ConnectionManager.GetHubContext <MyHub>();

            hubContext.Clients.All.addMessage("server", "ServerMessage");
            Console.WriteLine("Server Sending addMessage\n");
            ConfigureService.Configure();
            //using (WebApp.Start(url))
            //{

            //    Console.WriteLine("Server running on {0}", url);
            //    while (true)
            //    {
            //        string key = Console.ReadLine();
            //        if (key.ToUpper() == "W")
            //        {
            //            IHubContext hubContext = GlobalHost.ConnectionManager.GetHubContext<MyHub>();
            //            hubContext.Clients.All.addMessage("server", "ServerMessage");
            //            Console.WriteLine("Server Sending addMessage\n");
            //        }
            //        if (key.ToUpper() == "E")
            //        {
            //            IHubContext hubContext = GlobalHost.ConnectionManager.GetHubContext<MyHub>();
            //            hubContext.Clients.All.heartbeat();
            //            Console.WriteLine("Server Sending heartbeat\n");
            //        }
            //        if (key.ToUpper() == "R")
            //        {
            //            IHubContext hubContext = GlobalHost.ConnectionManager.GetHubContext<MyHub>();

            //            var vv = new HelloModel { Age = 37, Molly = "pushed direct from Server " };

            //            hubContext.Clients.All.sendHelloObject(vv);
            //            Console.WriteLine("Server Sending sendHelloObject\n");
            //        }
            //        if (key.ToUpper() == "C")
            //        {
            //            break;
            //        }


            //    }

            //    Console.ReadLine();
            //}
        }
Esempio n. 5
0
 static void Tick(object data)
 {
     ConfigureService.Configure();
     // Esto se ejecuta en un hilo combinado
     Console.WriteLine(data); // Escribe "tick..."
 }