Esempio n. 1
0
        static void Main(string[] args)
        {
            Console.Title = typeof(Program).Namespace;

            // 用于提供静态html页面,也可以用IIS
            var httpServer = new HttpServer();

            httpServer.StartListen(82);
            Console.WriteLine("http服务启动成功 ..");

            // 当浏览器不支持websocket时,将由flash实现
            var flexPolicyServer = new FlexPolicyServer();

            flexPolicyServer.StartListen();
            Console.WriteLine("flex策略服务启动成功 ..");

            // websocket服务
            var webSocketServer = new ChatWebSocketServer();

            webSocketServer.StartListen(83);
            Console.WriteLine("WebSocket服务启动成功 ..");


            // 设置进程的工作目录
            if (Directory.Exists("js") == false)
            {
                Directory.SetCurrentDirectory("../../");
            }
            Process.Start("http://localhost:82/index.html");
            Console.ReadLine();
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            Console.Title = typeof(Program).Namespace;

            // 用于提供静态html页面,也可以用IIS
            var httpServer = new HttpServer();
            httpServer.StartListen(82);
            Console.WriteLine("http服务启动成功 ..");

            // 当浏览器不支持websocket时,将由flash实现
            var flexPolicyServer = new FlexPolicyServer();
            flexPolicyServer.StartListen();
            Console.WriteLine("flex策略服务启动成功 ..");

            // websocket服务
            var webSocketServer = new ChatWebSocketServer();
            webSocketServer.StartListen(83);
            Console.WriteLine("WebSocket服务启动成功 ..");

            // 设置进程的工作目录
            if (Directory.Exists("js") == false)
            {
                Directory.SetCurrentDirectory("../../");
            }
            Process.Start("http://localhost:82/index.html");
            Console.ReadLine();
        }