Пример #1
0
        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();
        }
Пример #2
0
 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("Сервер сконфигурирован с настройками по умолчанию.");
     }
 }
Пример #3
0
 public static void Listen80()
 {
     httpServer = new HttpServer( World.ServerIP, World.HttpServerPort );
 }
Пример #4
0
 public static void Listen80()
 {
     httpServer = new HttpServer(World.ServerIP, World.HttpServerPort);
 }
Пример #5
0
 public static void Main(string[] args)
 {
     HttpServer.Run();
     Console.ReadKey();
 }
Пример #6
0
        static void Main(string[] args)
        {
            HttpServer s = new HttpServer(8080);

            s.Start();
        }
Пример #7
0
        static void Main(string[] args)
        {
            HttpServer server = new HttpServer(8000);

            server.run();
        }