示例#1
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();
        }
示例#2
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();
        }