static void Main(string[] args) { // create Event loop var loop = new EventLoop(); // create http server var httpsvr = new HttpServer(loop); httpsvr.Listen(8080); httpsvr.OnRequest += OnHttpRequest; httpsvr.OnUpgrade += OnHttpUpgrade; // create websocket server var wssvr = new WebSocketServer(loop); wssvr.OnConnection += OnWebsocketConnected; httpsvr.OnUpgrade += wssvr.HandleUpgrade; // create fastcgi server var cgisvr = new FastCGIServer(loop); cgisvr.OnRequest += OnFastCGIRequest; cgisvr.Listen(19000); // Run event loop loop.Run(); }
static void Main(string[] args) { server = new Server(4242); server.Start(); while (true) { Thread.Sleep(int.MaxValue); } }