public void run()
        {
            // configure http server but do not start running yet
            Servers.MinimalHTTPServer.ServerConfiguration config = new Servers.MinimalHTTPServer.ServerConfiguration();
            Servers.MinimalHTTPServer.Server server = new Servers.MinimalHTTPServer.Server(config);
            server.ServerNotify += server_ServerNotify;
            server.addHTTPResponsibility(new ElseResponsibility());
            server.addHTTPResponsibility(new RunningResponsibility());

            // configure web socket server but do not start running
            Servers.MinimalWebSocketServer.ServerConfiguration webSocketconfig = new Servers.MinimalWebSocketServer.ServerConfiguration();
            webSocketconfig.bufferSize = 100;
            Servers.MinimalWebSocketServer.Server webSocketServer = new Servers.MinimalWebSocketServer.Server(webSocketconfig);
            webSocketServer.ServerNotify += server_ServerNotify;

            DataSources          dataSources          = new DataSources();
            VesselChangeDetector vesselChangeDetector = new VesselChangeDetector();
            IKSPAPI kspAPI = new DummyKSPAPI(JSONFormatterProvider.Instance, vesselChangeDetector, config);

            webSocketServer.addWebSocketService("/server", new KSPWebSocketService(kspAPI));
            webSocketServer.subscribeToHTTPForStealing(server);

            // start the HTTP server
            server.startServing();
            Console.Read();
            server.stopServing();
        }
        public void run()
        {
            // configure http server but do not start running yet
            Servers.MinimalHTTPServer.ServerConfiguration config = new Servers.MinimalHTTPServer.ServerConfiguration();
            Servers.MinimalHTTPServer.Server server = new Servers.MinimalHTTPServer.Server(config);
            server.ServerNotify += server_ServerNotify;
            server.addHTTPResponsibility(new ElseResponsibility());
            server.addHTTPResponsibility(new RunningResponsibility());

            // configure web socket server but do not start running
            Servers.MinimalWebSocketServer.ServerConfiguration webSocketconfig = new Servers.MinimalWebSocketServer.ServerConfiguration();
            webSocketconfig.bufferSize = 100;
            Servers.MinimalWebSocketServer.Server webSocketServer = new Servers.MinimalWebSocketServer.Server(webSocketconfig);
            webSocketServer.ServerNotify += server_ServerNotify;

            DataSources dataSources = new DataSources();
            VesselChangeDetector vesselChangeDetector = new VesselChangeDetector(false);
            IKSPAPI kspAPI = new DummyKSPAPI(JSONFormatterProvider.Instance, vesselChangeDetector, config);

            //webSocketServer.addWebSocketService("/server", new KSPWebSocketService(kspAPI,));
            //webSocketServer.subscribeToHTTPForStealing(server);

            // start the HTTP server
            //server.startServing();
            //Console.Read();
            //server.stopServing();
        }
        public void run()
        {
            Servers.MinimalHTTPServer.ServerConfiguration config = new Servers.MinimalHTTPServer.ServerConfiguration();
            Servers.MinimalHTTPServer.Server server = new Servers.MinimalHTTPServer.Server(config);
            server.ServerNotify += server_ServerNotify;
            server.addHTTPResponsibility(new ElseResponsibility());
            server.addHTTPResponsibility(new RunningResponsibility());

            server.startServing();
            Console.Read();
            server.stopServing();
        }
        public void run()
        {
            // configure http server but do not start running yet
            Servers.MinimalHTTPServer.ServerConfiguration config = new Servers.MinimalHTTPServer.ServerConfiguration();
            Servers.MinimalHTTPServer.Server server = new Servers.MinimalHTTPServer.Server(config);
            server.ServerNotify += server_ServerNotify;
            server.addHTTPResponsibility(new ElseResponsibility());
            server.addHTTPResponsibility(new RunningResponsibility());

            // configure web socket server but do not start running
            Servers.MinimalWebSocketServer.ServerConfiguration webSocketconfig = new Servers.MinimalWebSocketServer.ServerConfiguration();
            webSocketconfig.bufferSize = 100;
            Servers.MinimalWebSocketServer.Server webSocketServer = new Servers.MinimalWebSocketServer.Server(webSocketconfig);
            webSocketServer.ServerNotify += server_ServerNotify;
            webSocketServer.addWebSocketService("/server", new WebSocketEchoService());
            webSocketServer.subscribeToHTTPForStealing(server);

            // start the HTTP server
            server.startServing();
            Console.Read();
            server.stopServing();
        }
Beispiel #5
0
        public void run()
        {
            // configure http server but do not start running yet
            Servers.MinimalHTTPServer.ServerConfiguration config = new Servers.MinimalHTTPServer.ServerConfiguration();
            Servers.MinimalHTTPServer.Server server = new Servers.MinimalHTTPServer.Server(config);
            server.ServerNotify += server_ServerNotify;
            server.addHTTPResponsibility(new ElseResponsibility());
            server.addHTTPResponsibility(new RunningResponsibility());

            // configure web socket server but do not start running
            Servers.MinimalWebSocketServer.ServerConfiguration webSocketconfig = new Servers.MinimalWebSocketServer.ServerConfiguration();
            webSocketconfig.bufferSize = 100;
            Servers.MinimalWebSocketServer.Server webSocketServer = new Servers.MinimalWebSocketServer.Server(webSocketconfig);
            webSocketServer.ServerNotify += server_ServerNotify;
            webSocketServer.addWebSocketService("/server", new WebSocketEchoService());
            webSocketServer.subscribeToHTTPForStealing(server);

            // start the HTTP server
            server.startServing();
            Console.Read();
            server.stopServing();
        }
        public void run()
        {
            Servers.MinimalHTTPServer.ServerConfiguration config = new Servers.MinimalHTTPServer.ServerConfiguration();
            Servers.MinimalHTTPServer.Server server = new Servers.MinimalHTTPServer.Server(config);
            server.ServerNotify += server_ServerNotify;
            server.addHTTPResponsibility(new ElseResponsibility());
            server.addHTTPResponsibility(new RunningResponsibility());

            server.startServing();
            Console.Read();
            server.stopServing();
        }