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

            s.Start();
        }
Exemplo n.º 7
0
        static void Main(string[] args)
        {
            HttpServer server = new HttpServer(8000);

            server.run();
        }