public ProcessInformation(Process process, string name, int index, int debugPort)
 {
     Process = process;
     Name = name;
     Index = index;
     DebugPort = debugPort;
 }
Пример #2
0
        public AdminServer()
        {
            var fs = Global.Require<FS>("fs");
            ServerLogger.InitLogger("AdminServer", "AdminServer");
            Logger.Start("Admin");

            ServerLogger.LogInformation("Shuffly Admin V0.51",null);

            var redis = Global.Require<Redis>("redis");
            var client = redis.CreateClient(6379, Constants.RedisIP);
           /* client.On<string,object>("monitor",(time, args) => {
                                   ServerLogger.Log("Monitor: "+time+" "+Json.Stringify(args),LogLevel.DebugInformation); 
                                });*/
             
            util = Global.Require<Util>("util");
            exec = Global.Require<ChildProcess>("child_process").Exec;
            __dirname = Constants.HARDLOCATION;
            nonDebuggable = new[] {"node-inspector", "pkill"};

            Global.Require<Http>("http").CreateServer(handler).Listen(8090);

            debug = true;
            Global.SetInterval(() => { Console.WriteLine("keep alive " + Common.ShortDate()); }, 10 * 1000);

            Global.Process.On("exit",
                              () => {
                                  ServerLogger.LogDebug("Exiting ",null);
                                  onAsk("k");
                                  runProcess("pkill", new[] {"node"});
                              });

            if (debug)
                onAsk("d", true);
           onAsk("d", true);
            if (debug) {
                nodeInspector = runProcess("node-inspector", new string[0]);
                ServerLogger.LogDebug("node-inspector Started",null);
            }

            onAsk("s");
        }