public override ClientNodeStatusWrapper GetClientNodeStatus(string cacheId) { string clientCacheId = string.Empty; ClientNodeStatus status = ClientConfigManager.GetClientNodeStatus(cacheId.ToLower(), out clientCacheId); if (status == ClientNodeStatus.ClientCacheUnavailable) { StatusInfo statusInfo = GetCacheStatus(clientCacheId.ToLower(), null); if (statusInfo.IsRunning) { status = ClientNodeStatus.ClientCacheDisabled; } } else if (status == ClientNodeStatus.ClientCacheDisabled) { StatusInfo statusInfo = GetCacheStatus(clientCacheId.ToLower(), null); if (statusInfo.IsRunning) { status = ClientNodeStatus.ClientCacheEnabled; } else if (statusInfo.IsUnavailable) { status = ClientNodeStatus.ClientCacheUnavailable; } } return(new ClientNodeStatusWrapper(status)); }
public override ClientNodeStatusWrapper GetClientNodeStatus(string cacheId) { string clientCacheId = string.Empty; ClientNodeStatus status = ClientConfigManager.GetClientNodeStatus(cacheId.ToLower(), out clientCacheId); return(new ClientNodeStatusWrapper(status)); }
public ClientNode(string name, int nodeID, string ipAddress, DateTime lastReport, ClientNodeStatus status) { Name = name; NodeID = nodeID; IpAddress = ipAddress; LastReport = lastReport; Status = status; }
public override void ProcessRequest(string request, ref Socket socket, bool authenticated, string body) { QueryString query = new QueryString(request); String sMimeType = "text/xml"; String name = ""; int nodeID = -1; float FPS = 0; string error = null; ClientNodeStatus status = ClientNodeStatus.Online; string StatusText = ""; if (!string.IsNullOrEmpty(query["NodeID"])) { nodeID = int.Parse(query["NodeID"]); } if (!string.IsNullOrEmpty(query["NodeName"])) { name = query["NodeName"]; } if (!string.IsNullOrEmpty(query["FPS"])) { FPS = float.Parse(query["FPS"]); } if (!string.IsNullOrEmpty(query["Error"])) { error = query["Error"]; } if (!string.IsNullOrEmpty(query["Status"])) { status = (ClientNodeStatus)Enum.Parse(typeof(ClientNodeStatus), query["Status"]); } if (!string.IsNullOrEmpty(query["StatusText"])) { StatusText = query["StatusText"]; } if (nodeID != -1 && !string.IsNullOrEmpty(name)) { string ip = ((IPEndPoint)socket.RemoteEndPoint).Address.ToString(); NetControl.LogStatusReport(nodeID, name, ip, status, StatusText, FPS, error); } String data = "<?xml version = \"1.0\" encoding=\"utf-8\"?>" + "<Status>Ok</Status>"; SendHeaderAndData(data, ref socket, sMimeType); }
internal static ClientNodeStatus GetClientNodeStatus(string cacheId, out string clientCacheId) { ClientNodeStatus status = ClientNodeStatus.Unavailable; clientCacheId = string.Empty; LoadXml(); if (_configuration != null && _configuration.CacheConfigurationsMap != null) { CacheConfiguration config = null; } return(status); }
internal static ClientNodeStatus GetClientNodeStatus(string cacheId, out string clientCacheId) { ClientNodeStatus status = ClientNodeStatus.Unavailable; clientCacheId = string.Empty; LoadXml(); if (_configuration != null && _configuration.CacheConfigurationsMap != null) { CacheConfiguration config = null; if (_configuration.CacheConfigurationsMap.TryGetValue(cacheId.ToLower(), out config)) { status = ClientNodeStatus.ClientCacheDisabled; } } return(status); }
internal static void ReportStatusOld(ClientNodeStatus status, string statusText, string error) { try { if (NetControl.MasterAddress == "127.0.0.1" || Settings.MasterController) { return; } if (Earth3d.Logging) { Earth3d.WriteLogMessage("Reporting Status:" + statusText); } currentStatus = status; CurrentStatusText = statusText; string url = string.Format("http://{0}:5050/status?NodeID={1}&NodeName={2}&FPS={3}&Error={4}&Status={5}&StatusText={6}" , NetControl.MasterAddress, Earth3d.MainWindow.Config.NodeID, Earth3d.MainWindow.Config.NodeDiplayName, Earth3d.LastFPS, error, status, statusText); ReportDelegate report = new ReportDelegate(Report); report.BeginInvoke(url, null, null); //WebClient client = new WebClient(); //client.DownloadStringAsync(new Uri(url)); } catch { } }
internal static void ReportStatus(ClientNodeStatus status, string statusText, string error) { MemoryStream stream = new MemoryStream(); if (string.IsNullOrEmpty(error)) { error = ""; } BinaryWriter bw = new BinaryWriter(stream); bw.Write((byte)42); bw.Write((byte)42); bw.Write((byte)13); //Status Packet bw.Write(Earth3d.MainWindow.Config.ClusterID); bw.Write(Earth3d.MainWindow.Config.NodeID); bw.Write(Earth3d.MainWindow.Config.NodeDiplayName); bw.Write(status.ToString()); bw.Write(statusText); bw.Write(Earth3d.LastFPS); bw.Write(error); bw.Flush(); SendStatus(stream.GetBuffer(), (int)stream.Length); }
internal static void LogStatusReport(int nodeID, string name, string ipAddress, ClientNodeStatus status, string statusText, float FPS, string error) { if (Earth3d.Logging) { Earth3d.WriteLogMessage("Received Status Report"); } NodeListDirty = true; ClientNode node = null; if (NodeList.ContainsKey(nodeID)) { node = NodeList[nodeID]; } else { node = new ClientNode(name, nodeID, ipAddress, DateTime.Now, status); NodeList[nodeID] = node; } if (string.IsNullOrEmpty(node.MacAddress)) { PhysicalAddress mac = NetControl.Arp(IPAddress.Parse(ipAddress)); node.MacAddress = mac.ToString(); } node.Name = name; node.Status = status; if (!string.IsNullOrEmpty(statusText)) { node.StatusText = statusText; } node.IpAddress = ipAddress; node.LastFPS = FPS; node.LastReport = DateTime.Now; if (!string.IsNullOrEmpty(error)) { node.ReportError(error); } }