public void Start()
        {
            var server = new Server(_listenToUrl);
            server.MapHubs();
            server.Start();
            Console.WriteLine("SignalR Server started at " + _listenToUrl);

            SingletonDDPClient.Connect(_meteorServerUrl, _dataSubscriber);
            Console.WriteLine("Connected to Meteor server at " + _meteorServerUrl);
        }
        public void Start()
        {
            var url = "http://localhost:17/";
            Server = new Server(url);

            Server.Start();

            // map the hubs (really only needed for hubs in external assemblies)
            Server.ConnectionManager.GetHubContext<TimeHub>();

            // map all the hubs so they're proxied
            Server.MapHubs();
        }
示例#3
0
        public override bool OnStart()
        {
            ServicePointManager.DefaultConnectionLimit = 12;

            // create the server
            server = new Server(
                new TableStorageSiteUrlRepository(), 
                new WorkerRoleHubConfiguration()
                );

            // run the server
            thread = new Thread(new ThreadStart(() => server.Run()));
            thread.Start();

            return base.OnStart();
        }
示例#4
0
        private static void Main()
        {
            const string url = "http://*****:*****@ {1}", connection.Url, DateTime.Now);
                                connection.Send("Hello Server");
                                Thread.Sleep(2000);
                            }
                        }
                        catch (Exception exception)
                        {
                            Console.WriteLine(exception);
                        }
                    }
                });

            Console.ReadLine();
        }
示例#5
0
        static void Main(string[] args)
        {
            Debug.Listeners.Add(new ConsoleTraceListener());
            Debug.AutoFlush = true;

            var server = new Server("http://localhost:8081/");
            server.MapHubs();

            server.Start();
            Console.WriteLine("Server running");

            while (true)
            {
                ConsoleKeyInfo ki = Console.ReadKey(false);
                if (ki.Key == ConsoleKey.Escape)
                {
                    break;
                }
            }
        }
示例#6
0
        static void Main(string[] args)
        {
            Debug.Listeners.Add(new ConsoleTraceListener());
            Debug.AutoFlush = true;

            string url = "http://localhost:8081/";
            var server = new Server(url);

            // Map /echo to the persistent connection
            server.MapConnection<MyConnection>("/echo");

            // Enable the hubs route (/signalr)
            server.EnableHubs();

            server.Start();

            Console.WriteLine("Server running on {0}", url);

            Console.ReadKey();
        }
        static void Main(string[] args)
        {
            var url = "http://localhost:17/";
            var server = new Server(url);
            /// need this line when hosting signalR from another dll
            server.ConnectionManager.GetHubContext<WebApplication.ChatHub_4>();
            server.MapHubs();
            server.Start();
            Console.WriteLine(string.Format("signalr running on: {0}", url));

            var timer = new System.Timers.Timer(5000);
            timer.Elapsed += (o, e) =>
            {
                var context = GlobalHost.ConnectionManager.GetHubContext<WebApplication.ChatHub_4>();
                Console.WriteLine("ping back from self host");
                context.Clients.addLog("ping back from self host");
            };
            timer.Start();

            Console.ReadLine();
        }
示例#8
0
        static void Main(string[] args)
        {
            string url = "http://localhost:8999/";
            var server = new Server(url);

            // Map the default hub url (/signalr)
            server.MapHubs();

            // Start the server
            server.Start();

            Console.WriteLine("Server running on {0}", url);

            // Keep going until somebody hits 'x'
            while (true)
            {
                ConsoleKeyInfo ki = Console.ReadKey(true);
                if (ki.Key == ConsoleKey.X)
                {
                    break;
                }
            }
        }
示例#9
0
 public void Start()
 {
     _server = new Server("http://localhost:17/", new NinjectDependencyResolver(_kernel));
     _server.MapHubs();
     _server.Start();
 }
示例#10
0
文件: Program.cs 项目: osbornm/Playr
        static void Main(string[] args)
        {
            var config = new HttpSelfHostConfiguration(ApplicationSettings.apiBaseUrl);
            config.MaxReceivedMessageSize = 1024 * 1024 * 1024;
            config.MessageHandlers.Add(new CorsHandler());
            Routes.RegisterRoutes(config.Routes);
            var apiServer = new HttpSelfHostServer(config);
            apiServer.OpenAsync().Wait();
            var signalrServer = new Server(ApplicationSettings.signalrBaseUrl);
            signalrServer.MapHubs("/signalr");
            signalrServer.Start();

            Helpers.InitializeDocumentStore();
            var itunes = new iTunesAppClass();
            Start(itunes);

            Console.WriteLine("API is avalible at " + ApplicationSettings.apiBaseUrl);
            Console.WriteLine("Singlar Nortifications avalible at " + ApplicationSettings.signalrBaseUrl);
            Console.WriteLine("See http://github.com/osbornm/playr for more information on setup.");
            Console.WriteLine();
            Console.WriteLine("Press any key to stop server...");
            Console.ReadLine();

            // Stop Everything
            apiServer.CloseAsync().Wait();
            signalrServer.Stop();
            Stop(itunes);
            Marshal.ReleaseComObject(itunes);
        }