static void Main(string[] args) { // http服务 用于提供静态html页面(也可以用IIS) var http = new HttpServer(); http.StartListen(82); // websocket服务 var webSocket = new ChatWebSocketServer(); webSocket.GlobalFilter.Add(new ExceptionFilter()); // 异常处理 webSocket.BindService<ChatService>(); // 关联服务 webSocket.StartListen(83); Console.WriteLine("http服务启动成功 .."); Process.Start("http://localhost:82/index.html"); Console.ReadLine(); }
static void Main(string[] args) { // http服务 用于提供静态html页面(也可以用IIS) var http = new HttpServer(); http.StartListen(82); // websocket服务 var webSocket = new ChatWebSocketServer(); webSocket.GlobalFilter.Add(new ExceptionFilter()); // 异常处理 webSocket.BindService <ChatService>(); // 关联服务 webSocket.StartListen(83); Console.WriteLine("http服务启动成功 .."); Process.Start("http://localhost:82/index.html"); Console.ReadLine(); }