Ejemplo n.º 1
0
        public override string Handle(IDictionary<string, string> arguments)
        {
            var cpu = new CpuLoad();
            var disk = new DiskActivity();

            var returnString = JsonConvert.SerializeObject(new { Type = "SystemInfo", Data = new { Cpu = cpu.Count(), Disk = disk.Count() } });
            return returnString;
        }
Ejemplo n.º 2
0
        public void Start()
        {
            _clients = new List<TcpClient>();

            _webSocket = new WebSocketServer(5050);
            _webSocket.ClientDisconnected += _webSocket_ClientDisconnected;
            _webSocket.NewMessage += _webSocket_NewMessage;

            _webSocket.Start();

            _cpuLoad = new CpuLoad();
            _cpuLoad.Update += _cpuLoad_Update;

            _ramUsage = new RamUsage();
            _ramUsage.Update += _ramUsage_Update;

            _diskActivity = new DiskActivity();
            _diskActivity.Update += _diskActivity_Update;

            _httpServer = new CCHttpServer();
        }