public void Init() { _httpsv = new HttpServer(4649); //_httpsv.Sweeped = false; //_httpsv.AddWebSocketService<Echo>("/Echo"); _httpsv.AddWebSocketService<KinectService>("/"); _httpsv.OnGet += (sender, e) => { onGet(e); }; _httpsv.OnError += (sender, e) => { write(e.Message); }; _httpsv.Start(); write(String.Format("HTTP Server listening on port: {0} service path:", _httpsv.Port)); foreach (var path in _httpsv.ServicePaths) write(String.Format(" {0}", path)); write(""); write("Press any key to stop server..."); //Console.ReadLine(); //_httpsv.Stop(); }
private static void ConfigureServer(string settingFilePath) { Server = new HttpServer(); try { var settingDocument = ReadSettingXmlFile(settingFilePath); Server.Port = GetElementAttributeValue(settingDocument, "port", "value"); Server.MaxConnection = GetElementAttributeValue(settingDocument, "max_connection", "value"); } catch (Exception) { Console.WriteLine("Сервер сконфигурирован с настройками по умолчанию."); } }
public static void Listen80() { httpServer = new HttpServer( World.ServerIP, World.HttpServerPort ); }
public static void Listen80() { httpServer = new HttpServer(World.ServerIP, World.HttpServerPort); }
public static void Main(string[] args) { HttpServer.Run(); Console.ReadKey(); }
static void Main(string[] args) { HttpServer s = new HttpServer(8080); s.Start(); }
static void Main(string[] args) { HttpServer server = new HttpServer(8000); server.run(); }