diff --git a/Program.cs b/Program.cs index c19f4a9..dac9e7c 100644 --- a/Program.cs +++ b/Program.cs @@ -29,30 +29,22 @@ namespace ln.skyscanner public static void Main(string[] args) { - new IPv4(0); - FileLogger fileLogger = new FileLogger("skyscanner.log"); fileLogger.MaxLogLevel = LogLevel.INFO; Logger.Default.Backends.Add(fileLogger); Logger.ConsoleLogger.MaxLogLevel = LogLevel.INFO; - SkyScanner skyScanner = new SkyScanner(args); + SkyScanner skyScanner = new SkyScanner(); Initialize(); - skyScanner.Start(); + skyScanner.Start(args); } private static void Initialize() { - SNMPEngine.DefaultEngine.Timeout = 3500; - - if (!SkyScanner.Instance.Entities.BlockedNetworks.Contains(Network4.Parse("192.168.0.0/16"))) - SkyScanner.Instance.Entities.BlockedNetworks.Insert(Network4.Parse("192.168.0.0/16")); - if (!SkyScanner.Instance.Entities.BlockedNetworks.Contains(Network4.Parse("10.200.0.0/16"))) - SkyScanner.Instance.Entities.BlockedNetworks.Insert(Network4.Parse("10.200.0.0/16")); - +// SNMPEngine.DefaultEngine.Timeout = 3500; } } diff --git a/SkyScanner.cs b/SkyScanner.cs index c220e48..b662bd3 100644 --- a/SkyScanner.cs +++ b/SkyScanner.cs @@ -6,26 +6,30 @@ using ln.skyscanner.http; using System.IO; using ln.skyscanner.crawl; using ln.types.threads; -using System.Threading; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using ln.skyscanner.checks; -using System.Collections.Generic; using ln.skyscanner.import.skytron; using System.Linq; using ln.skyscanner.entities; -using ln.types.json; using Newtonsoft.Json.Linq; +using ln.types.net; +using ln.application; +using ln.application.service; +using ln.skyscanner.services; +using Renci.SshNet.Messages; +using System.Threading; +using ln.http.resources; +using ln.types.rpc; namespace ln.skyscanner { [JsonConverter(typeof(StringEnumConverter))] public enum ComponentState { STOPPED, INITIALIZED, STARTED, FAILED, STOPPING } - public class SkyScanner + public class SkyScanner : Application { public static SkyScanner Instance { get; private set; } - public String[] Arguments { get; } public String BasePath { get; private set; } public Pool ConveniencePool { get; } @@ -35,192 +39,169 @@ namespace ln.skyscanner public SkyEntities Entities { get; private set; } public SkyChecker Checker { get; private set; } - public MemoryLogger MemoryLogger { get; private set; } + public bool OptionDisableChecker { get; private set; } + public String OptionCrawlVendor { get; private set; } - public SkyScanner(String[] args) - :this() + public SkyScanner() { - MemoryLogger = new MemoryLogger(4096); - Logger.Default.Backends.Add(MemoryLogger); + if (Instance != null) + throw new NotSupportedException("only one SkyScanner may be created"); + Instance = this; + + Arguments + .Add(0, "base-path", Path.GetFullPath("/var/cache/ln.skyscanner")) + .Add(0, "import-skytron", null) + .Add(0, "benchmark", null) + .Add(0, "debug-check", null) + .Add("disable-checker") + .Add(0, "crawl-vendor", null) + .Add(0, "crawl", null) + ; + Logging.Log(LogLevel.INFO, "SkyScanner: Constructor"); - - BasePath = Path.GetFullPath("/var/cache/ln.skyscanner"); - + BasePath = Arguments["base-path"].Value; Logging.Log(LogLevel.INFO, "SkyScanner: BasePath={0}", BasePath); + ConveniencePool = new Pool(); + } - Arguments = args; + public override void PrepareStart() + { + base.PrepareStart(); - String skytronImport = null; - String benchMark = null; - String debugCheckNode = null; - - Queue qArguments = new Queue(Arguments); - while (qArguments.Count > 0) + if (Arguments["import-skytron"].IsSet) { - string arg = qArguments.Dequeue(); - switch (arg) - { - case "-p": - BasePath = Path.GetFullPath(qArguments.Dequeue()); - break; - case "--import-skytron": - skytronImport = qArguments.Dequeue(); - break; - case "--benchmark": - benchMark = qArguments.Dequeue(); - break; - case "--debug-check": - debugCheckNode = qArguments.Dequeue(); - break; - } - } - - Entities = new SkyEntities(this); - Checker = new SkyChecker(); - - if (skytronImport != null) - { - SkytronImport si = new SkytronImport(skytronImport); + SkytronImport si = new SkytronImport(Arguments["import-skytron"].Value); si.Import(); } - if (benchMark != null) + if (Arguments["benchmark"].IsSet) { - switch (benchMark) + switch (Arguments["benchmark"].Value) { case "odb": BenchmarkODB(); break; default: - Logging.Log(LogLevel.ERROR, "Unknown Benchmark: {0}", benchMark); + Logging.Log(LogLevel.ERROR, "Unknown Benchmark: {0}", Arguments["benchmark"].Value); break; } throw new Exception("Quitting after benchmarking"); } + /* + if (crawlHost != null) + { + CrawlHost(crawlHost); + throw new Exception("Quitting after --crawl"); + } - if (debugCheckNode != null) + if (debugCheckNode != null) + { + DebugCheck(debugCheckNode); + throw new Exception("Quitting after --debug-check"); + } + */ + + ServiceContainer.Add(ServiceDefinition.From(true)); + ServiceContainer.Add(ServiceDefinition.From(true)); + ServiceContainer.Add(ServiceDefinition.From(true)); + ServiceContainer.Add(ServiceDefinition.From(true)); + } + + + public class Service : ApplicationServiceBase + { + public WebSocketInterface webSocketInterface { get; private set; } + public RPCContainer RPCContainer { get; private set; } + + public Service() + : base("SkyScanner Application Service") { - DebugCheck(debugCheckNode); - throw new Exception("Qutting after --debug-check"); + RPCContainer = new RPCContainer(); } - - } - private SkyScanner() - { - if (Instance != null) - throw new NotSupportedException("only one SkyScanner may be created"); - Instance = this; - } - - - public void Start() - { - Logging.Log(LogLevel.INFO, "SkyScanner: Start()"); - - StartHttpServer(); - StartCrawler(); - - Checker.Start(); - - lock (this) + public override void ServiceMain(IApplicationInterface applicationInterface) { - Monitor.Wait(this); - } - } + String BasePath = "."; - public void Stop() - { - Logging.Log(LogLevel.INFO, "SkyScanner: Stop()"); + Resource rootResource = applicationInterface.HTTPApplication.RootResource; + String TemplatesBasePath = Path.Combine(BasePath, "templates", "static"); - Checker.Stop(); + /* Development hint */ + if (Directory.Exists("../../templates/static")) + TemplatesBasePath = Path.Combine(BasePath, "..", "..", "templates", "static"); - StopCrawler(); + DirectoryResource staticTemplates = new DirectoryResource(rootResource, TemplatesBasePath); - new Thread(() => ConveniencePool.Close()).Start(); + staticTemplates.ResourceTypeHook = ResourceTypeHook; + staticTemplates.DefaultResource = staticTemplates.GetResource("index.html"); - StopHttpServer(); + rootResource.DefaultResource = staticTemplates; - lock (this) - { - Monitor.Pulse(this); - } - } + webSocketInterface = new WebSocketInterface(rootResource, this); + RPCContainer.Add("", new SkyScannerRpc(this)); - /** HTTP Server **/ + long nextCycle = DateTimeOffset.Now.ToUnixTimeMilliseconds(); - public ComponentState HttpStatus - { - get - { - if (HTTPServer != null) + while (!StopRequested) { - if (HTTPServer.IsRunning) - return ComponentState.STARTED; + while ((nextCycle - DateTimeOffset.Now.ToUnixTimeMilliseconds()) < 0) + nextCycle += 1000; - return ComponentState.INITIALIZED; + try + { + int timeOut = (int)(nextCycle - DateTimeOffset.Now.ToUnixTimeMilliseconds()); + if (timeOut > 0) + Thread.Sleep(timeOut); + } + catch (ThreadInterruptedException) + { + if (StopRequested) + break; + } + + /* Send Application State to WebSockets */ + + JObject msg = new JObject(); + JObject stateObject = new JObject(); + stateObject["currentTime"] = DateTimeOffset.Now.ToUnixTimeMilliseconds(); + + msg["state"] = stateObject; + + webSocketInterface.Broadcast(msg); } - return ComponentState.STOPPED; + } - } - public void StartHttpServer() - { - HTTPServer = new HTTPServer(); - HTTPServer.AddEndpoint(new System.Net.IPEndPoint(IPAddress.Any,8080)); - - HTTPServer.DefaultApplication = new SkyScannerHttpApplication(this); - - HTTPServer.Start(); - } - - public void StopHttpServer() - { - if (HTTPServer != null) + private Resource ResourceTypeHook(DirectoryResource directoryResource, FileInfo fileInfo) { - if (HTTPServer.IsRunning) + if (fileInfo.Extension.Equals(".html")) + return new TemplateResource(directoryResource, fileInfo.FullName); + + return null; + } + + class SkyScannerRpc + { + Service skyscannerService; + + public SkyScannerRpc(Service skyscannerService) { - HTTPServer.Stop(); + this.skyscannerService = skyscannerService; } - } - } - - /** Crawler **/ - - public ComponentState CrawlerStatus - { - get - { - if (Crawler != null) + public string GetServerString() { - return Crawler.CrawlerState; + return "SkyScanner 0.1a"; } - return ComponentState.STOPPED; - } - } - public void StartCrawler() - { - if (Crawler == null) - { - Crawler = new Crawler(this); - } - else - { - Crawler.Start(); - } - } - public void StopCrawler() - { - if (Crawler != null) - { - Crawler.Stop(); + } + + } public void BenchmarkODB() @@ -244,6 +225,23 @@ namespace ln.skyscanner } + public void CrawlHost(IPv4 ip) + { + Logger.ConsoleLogger.MaxLogLevel = LogLevel.DEBUGFULL; + + CrawledHost crawledHost = new CrawledHost(); + crawledHost.Name = ip.ToString(); + crawledHost.PrimaryIP = ip; + crawledHost.IPAddresses = new IPv4[] { ip }; + + Crawl crawl = new Crawl(Crawler, crawledHost); + crawl.Prepare(); + crawl.RunJob(); + + Logging.Log(LogLevel.INFO, "CrawledHost: {0}", JObject.FromObject(crawledHost).ToString()); + + } + public void DebugCheck(String uniqueID) { Logger.ConsoleLogger.MaxLogLevel = LogLevel.DEBUGFULL; diff --git a/checks/SikluCheck.cs b/checks/SikluCheck.cs new file mode 100644 index 0000000..b175d6d --- /dev/null +++ b/checks/SikluCheck.cs @@ -0,0 +1,64 @@ +using System; +using ln.skyscanner.entities; +using ln.logging; +using ln.types; +using ln.snmp; +using ln.snmp.types; + +namespace ln.skyscanner.checks +{ + public class SikluCheck : SkyCheck + { + public SikluCheck() + :base("siklu") + { + } + + public override void Check(SkyChecker skyChecker, ref SkyCheckState checkState, Node node) + { + foreach (URI snmpUri in node.FindURIs("snmp")) + { + try + { + using (SnmpInterface snmp = SnmpInterface.FromURI(snmpUri, skyChecker.SNMPEngine)) + { + Sequence[][] ptp = snmp.snmpWalk(new string[] { + "1.3.6.1.4.1.31926.2.1.1.19", // RX PWR + "1.3.6.1.4.1.31926.2.1.1.18", // SNR + "1.3.6.1.4.1.31926.2.1.1.42" // TX PWR + }); + + int n = 0; + foreach (Sequence[] row in ptp) + { + checkState.WritePerformanceValue(String.Format("ptp_rx_pwr_{0}", n), (double)((Integer)(row[0].Items[1])).LongValue, -75.0, 0, -80.0, 0); + checkState.WritePerformanceValue(String.Format("ptp_tx_snr_{0}", n), (double)((Integer)(row[1].Items[1])).LongValue); + checkState.WritePerformanceValue(String.Format("ptp_tx_pwr_{0}", n), (double)((Integer)(row[2].Items[1])).LongValue); + + /* long rxBytes = ((Integer)(row[4].Items[1])).LongValue; + long txBytes = ((Integer)(row[5].Items[1])).LongValue; + + ubiquityCheckState.RXRate.Update(rxBytes * 8); + ubiquityCheckState.TXRate.Update(txBytes * 8); + + ubiquityCheckState.WritePerformanceValue("ptp_rx_rate", ubiquityCheckState.RXRate.Current); + ubiquityCheckState.WritePerformanceValue("ptp_tx_rate", ubiquityCheckState.TXRate.Current); + */ + n++; + } + } + break; + } catch (Exception e) + { + Logging.Log(LogLevel.DEBUG, "Exception caught in SikluCheck: {0}", e); + continue; + } + } + } + + public override bool IsValid(Node node) + { + return (node.Vendor != null) && node.Vendor.Equals("Siklu"); + } + } +} diff --git a/checks/SkyCheck.cs b/checks/SkyCheck.cs index 688b558..ba1960a 100644 --- a/checks/SkyCheck.cs +++ b/checks/SkyCheck.cs @@ -43,6 +43,7 @@ namespace ln.skyscanner.checks AddSkyCheck(new Hostalive()); AddSkyCheck(new Ubiquiti()); AddSkyCheck(new Mimosa()); + //AddSkyCheck(new SikluCheck()); AddSkyCheck(new APC()); } } diff --git a/checks/SkyChecker.cs b/checks/SkyChecker.cs index 7649e62..74201df 100644 --- a/checks/SkyChecker.cs +++ b/checks/SkyChecker.cs @@ -18,10 +18,8 @@ using System.Linq; using ln.logging; using ln.snmp; using ln.http.resources; -using ln.types.odb; using System.Collections.Generic; -using ln.types.odb.mapped; -using System.Runtime.CompilerServices; + namespace ln.skyscanner.checks { public class SkyChecker @@ -87,7 +85,7 @@ namespace ln.skyscanner.checks if ((threadScheduler != null) && (threadScheduler.IsAlive)) throw new NotSupportedException("SkyChecker.scheduler() already running"); - checkPool.SetPoolSize(128); + checkPool.SetPoolSize(256); Thread.Sleep(2500); diff --git a/crawl/Crawler.cs b/crawl/Crawler.cs index 30d7d5e..d29332b 100644 --- a/crawl/Crawler.cs +++ b/crawl/Crawler.cs @@ -19,6 +19,7 @@ using ln.types.odb; using ln.skyscanner.crawl.service; using ln.skyscanner.crawl.tests; using ln.types.net; +using ln.skyscanner.entities; namespace ln.skyscanner.crawl { @@ -26,6 +27,8 @@ namespace ln.skyscanner.crawl { static Crawler() { + + CrawlService.RegisterService(new TCP(new int[] { 13080, 13022, 80, 22, 443, 13443 })); CrawlService.RegisterService(new SNMP(new string[] { "VhclfC7lfIojYZ", "Vhclf(C7$lfIojYZ", "ByFR4oW98hap", "qVy3hnZJ2fov" })); CrawlService.RegisterService(new RFC1213()); @@ -53,6 +56,8 @@ namespace ln.skyscanner.crawl [JsonConverter(typeof(StringEnumConverter))] public ComponentState CrawlerState { get; private set; } + public CredentialsGenerator Credentials { get; } = new CredentialsGenerator(); + Thread threadScheduler; public Crawler(SkyScanner skyScanner) @@ -68,6 +73,26 @@ namespace ln.skyscanner.crawl Directory.CreateDirectory(PoolPath); CrawlerState = ComponentState.INITIALIZED; + + Credentials + .AddPasswords(new string[]{ + "MNX3oTzhp9am", + "f1whWdj5E2Mo", + "f1whWdj5", + "0Sl71eGw", + "0Sl71eGwVdjI6WeW", + "67E3xpTc", + "67E3xpTcMbwR", + "v1kXbeCux0Td", + "v1kXbeCu", + "YNZRtVUFH94b", + "67E3xpTcMbwR", + "v1kXbeCux0Td", + "DVqxof1JQ9at" + }) + .AddUserNames(new string[] { "skytron", "admin", "root" }) + ; + } catch (Exception) { @@ -98,6 +123,16 @@ namespace ln.skyscanner.crawl } CrawlerState = ComponentState.STARTED; + + if (SkyScanner.Instance.OptionCrawlVendor != null) + { + foreach (Node node in SkyScanner.Instance.Entities.NodeCollection.Query("Vendor", SkyScanner.Instance.OptionCrawlVendor)) + { + CrawledHost crawledHost = FindHostForIP(node.PrimaryIP); + Crawl(crawledHost); + } + } + } } diff --git a/crawl/CredentialsGenerator.cs b/crawl/CredentialsGenerator.cs new file mode 100644 index 0000000..6e5161b --- /dev/null +++ b/crawl/CredentialsGenerator.cs @@ -0,0 +1,67 @@ +using System; +using System.Collections; +using System.Collections.Generic; +namespace ln.skyscanner.crawl +{ + public class CredentialsGenerator : IEnumerable + { + HashSet userNames = new HashSet(); + HashSet passWords = new HashSet(); + + public CredentialsGenerator() + { + } + + + public CredentialsGenerator AddUserNames(IEnumerable usernames) + { + foreach (String userName in usernames) + AddUserName(userName); + + return this; + } + public CredentialsGenerator AddUserName(String username) + { + userNames.Add(username); + return this; + } + + public CredentialsGenerator AddPasswords(IEnumerable passwords) + { + foreach (String pw in passwords) + AddPassword(pw); + return this; + } + + public CredentialsGenerator AddPassword(String password) + { + passWords.Add(password); + return this; + } + + public IEnumerator GetEnumerator() + { + foreach (String username in userNames) + foreach (String pw in passWords) + yield return new Credential(username, pw); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + } + + public class Credential + { + public String Username { get; } + public String Password { get; } + + public Credential(String username,String password) + { + Username = username; + Password = password; + } + } + +} diff --git a/crawl/service/SSH.cs b/crawl/service/SSH.cs index b224327..0ba5308 100644 --- a/crawl/service/SSH.cs +++ b/crawl/service/SSH.cs @@ -14,27 +14,11 @@ using Renci.SshNet.Common; using System.Net.Sockets; using ln.types.net; using ln.skyscanner.crawl.service; +using ln.logging; namespace ln.skyscanner.crawl.tests { public class SSH : CrawlService { - static string[] defaultPasswords = new string[] - { - "MNX3oTzhp9am", - "f1whWdj5E2Mo", - "f1whWdj5", - "0Sl71eGw", - "0Sl71eGwVdjI6WeW", - "67E3xpTc", - "67E3xpTcMbwR", - "v1kXbeCux0Td", - "v1kXbeCu", - "YNZRtVUFH94b", - "67E3xpTcMbwR", - "v1kXbeCux0Td", - "DVqxof1JQ9at" - }; - public SSH() : base("ssh") { @@ -68,11 +52,14 @@ namespace ln.skyscanner.crawl.tests { foreach (int port in new int[] { 13022, 22 }) { + if (crawledHost.HasHint(String.Format("tcp.{0}",port)) && crawledHost.GetHint(String.Format("tcp.{0}", port))) try { - foreach (string password in defaultPasswords) + foreach (Credential credential in SkyScanner.Instance.Crawler.Credentials) { - if (CanConnect(crawledHost, ip, port, "skytron", password, true)) + Logging.Log(LogLevel.DEBUG, "SSH trying {0}:{1}...", credential.Username, credential.Password.Substring(0, 4)); + + if (CanConnect(crawledHost, ip, port, credential.Username, credential.Password, true)) return true; } } catch (SocketException) @@ -88,9 +75,12 @@ namespace ln.skyscanner.crawl.tests { using (SshClient client = new SshClient(host.ToString(), port, username, password)) { - client.ConnectionInfo.Timeout = TimeSpan.FromSeconds(1); + client.ConnectionInfo.Timeout = TimeSpan.FromSeconds(5); try { + String authBanner = null; + client.ConnectionInfo.AuthenticationBanner += (object sender, AuthenticationBannerEventArgs e) => authBanner = e.BannerMessage; + client.Connect(); crawledHost.SetHint("ssh.port", client.ConnectionInfo.Port); @@ -98,12 +88,14 @@ namespace ln.skyscanner.crawl.tests crawledHost.SetHint("ssh.login", client.ConnectionInfo.Username); crawledHost.SetHint("ssh.password", password); crawledHost.SetHint("ssh.version", client.ConnectionInfo.ServerVersion); + crawledHost.SetHint("ssh.authbanner", authBanner); client.Disconnect(); return true; } - catch (SshException) + catch (SshException sshe) { + Logging.Log(sshe); } catch (SocketException) { diff --git a/devices/Siklu.cs b/devices/Siklu.cs new file mode 100644 index 0000000..364ff00 --- /dev/null +++ b/devices/Siklu.cs @@ -0,0 +1,78 @@ +using System; +using ln.types.net; +using System.Net.Http; +using System.Threading.Tasks; +using System.Net; +using System.Security.Cryptography.X509Certificates; +using System.Net.Security; +using ln.logging; + +namespace ln.skyscanner.devices +{ + public class Siklu + { + public IPv4 IPAddress { get; } + public String Username { get; set; } + public string Password { get; set; } + + CookieContainer cookieContainer = new CookieContainer(); + WebRequestHandler webRequestHandler; + HttpClient httpClient; + + public Siklu(IPv4 ip,string username,string password) + { + IPAddress = ip; + Username = username; + Password = password; + + webRequestHandler = new WebRequestHandler(); + webRequestHandler.ServerCertificateValidationCallback = (object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) => true; + webRequestHandler.UseCookies = true; + webRequestHandler.CookieContainer = cookieContainer; + webRequestHandler.AllowAutoRedirect = true; + + httpClient = new HttpClient(webRequestHandler); + + Logging.Log(LogLevel.INFO, "Siklu: {0}", IPAddress); + } + + public void Close() + { + httpClient.Dispose(); + httpClient = null; + } + + public bool Index() + { + HttpResponseMessage responseMessage = httpClient.GetAsync(String.Format("https://{0}/",IPAddress.ToString())).Result; + + foreach (var h in responseMessage.Content.Headers) + { + Logging.Log(LogLevel.INFO, "Siklue Header: {0}: [{1}]", h.Key, string.Join(",", h.Value)); + } + + return true; + } + + public bool Authenticate() + { + MultipartFormDataContent mfdc = new MultipartFormDataContent(); + mfdc.Add(new StringContent(Username), "user"); + mfdc.Add(new StringContent(Password), "password"); + mfdc.Add(new StringContent("/"), "caller_url"); + + try + { + HttpResponseMessage responseMessage = httpClient.PostAsync(String.Format("https://{0}/handleform", IPAddress.ToString()), mfdc).Result; + } + catch (Exception e) + { + Logging.Log(e); + } + + return true; + } + + + } +} diff --git a/http/SkyScannerHttpManagement.cs b/http/SkyScannerHttpManagement.cs index 2738749..ceeb00f 100644 --- a/http/SkyScannerHttpManagement.cs +++ b/http/SkyScannerHttpManagement.cs @@ -28,7 +28,7 @@ namespace ln.skyscanner.http { SkyScanner = skyScanner; } - + /* [Callable] public SkyScannerStatistics GetStatistics() { @@ -78,7 +78,6 @@ namespace ln.skyscanner.http { ServerTime = DateTime.Now.ToString(); - States.HttpServer = skyScanner.HttpStatus; States.Crawler = skyScanner.CrawlerStatus; States.Checks = ComponentState.STOPPED; @@ -97,5 +96,7 @@ namespace ln.skyscanner.http public ComponentState Checks; public ComponentState Dispatcher; } + +*/ } } diff --git a/http/WebSocketInterface.cs b/http/WebSocketInterface.cs new file mode 100644 index 0000000..9509e4c --- /dev/null +++ b/http/WebSocketInterface.cs @@ -0,0 +1,86 @@ +using System; +using ln.http.resources.websocket; +using ln.http.resources; +using Newtonsoft.Json.Linq; +using ln.logging; +using System.Collections.Generic; +using ln.http.websocket; +using System.Linq; +using ln.types.rpc; +using Newtonsoft.Json; + +namespace ln.skyscanner.http +{ + public class WebSocketInterface : WebsocketResource + { + SkyScanner.Service SkyScannerService { get; } + + public WebSocket[] CurrentWebSockets { + get + { + lock (currentWebSockets) + { + return currentWebSockets.ToArray(); + } + } + } + HashSet currentWebSockets = new HashSet(); + + public WebSocketInterface(Resource container,SkyScanner.Service skyscannerService) + :base(container,"socket") + { + SkyScannerService = skyscannerService; + Connection += WebSocketInterface_Connection; + } + + void WebSocketInterface_Connection(WebsocketResource webSocketResource, ln.http.websocket.WebSocket webSocket, WSREvent ev) + { + lock (currentWebSockets) + { + switch (ev) + { + case WSREvent.CONNECT: + currentWebSockets.Add(webSocket); + break; + case WSREvent.CLOSE: + currentWebSockets.Remove(webSocket); + break; + } + } + } + + public void Broadcast(JObject json) + { + Broadcast(json.ToString()); + } + + public void Broadcast(String text) + { + foreach (WebSocket webSocket in CurrentWebSockets) + { + webSocket.Send(text); + } + } + + public override void MessageReceived(WebSocketResourceRequestContext requestContext, string textMessage) + { + try + { + JObject json = JObject.Parse(textMessage); + RPCCall rpcCall = new RPCCall(json); + + RPCResult rpcResult = SkyScannerService.RPCContainer.Invoke(rpcCall); + + requestContext.WebSocket.Send( + rpcResult.ToJSON().ToString() + ); + + } + catch (Exception e) + { + Logging.Log(e); + } + } + + } +} diff --git a/import/skytron/SkytronImport.cs b/import/skytron/SkytronImport.cs index dbba948..b9d4c4e 100644 --- a/import/skytron/SkytronImport.cs +++ b/import/skytron/SkytronImport.cs @@ -96,10 +96,13 @@ namespace ln.skyscanner.import.skytron if (reader.GetInt32("http_port") != 0) { + string proto = reader.GetInt32("http_port") == 443 ? "https" : "http"; node.RemoveURI("http"); - node.AddURI(new URI(String.Format("http://{0}:{1}", + node.RemoveURI("https"); + node.AddURI(new URI(String.Format("{2}://{0}:{1}", primaryIP, - reader.GetString("http_port") + reader.GetString("http_port"), + proto ))); } if (reader.GetInt32("ssh_port") != 0) diff --git a/ln.skyscanner.csproj b/ln.skyscanner.csproj index 8cd2e49..909a8d3 100644 --- a/ln.skyscanner.csproj +++ b/ln.skyscanner.csproj @@ -57,6 +57,7 @@ + @@ -105,6 +106,13 @@ + + + + + + + @@ -255,6 +263,8 @@ + + @@ -285,6 +295,10 @@ {AD0267BB-F08C-4BE1-A88D-010D49041761} ln.templates + + {44AA3A50-7214-47F2-9D60-6FF34C0FE6D3} + ln.application + \ No newline at end of file diff --git a/mono_crash.1adb36dd9e.0.json b/mono_crash.1adb36dd9e.0.json deleted file mode 100644 index a57949a..0000000 --- a/mono_crash.1adb36dd9e.0.json +++ /dev/null @@ -1,2539 +0,0 @@ -{ - "protocol_version" : "0.0.3", - "configuration" : { - "version" : "(5.18.1.0) (tarball)", - "tlc" : "__thread", - "sigsgev" : "altstack", - "notifications" : "epoll", - "architecture" : "amd64", - "disabled_features" : "none", - "smallconfig" : "disabled", - "bigarrays" : "disabled", - "softdebug" : "enabled", - "interpreter" : "enabled", - "llvm_support" : "600", - "suspend" : "preemptive" - }, - "memory" : { - "minor_gc_time" : "1325988", - "major_gc_time" : "59217", - "minor_gc_count" : "112", - "major_gc_count" : "2", - "major_gc_time_concurrent" : "290014" - }, - "threads" : [ - { - "is_managed" : true, - "offset_free_hash" : "0x549be692b", - "offset_rich_hash" : "0x549be6b31", - "crashed" : false, - "native_thread_id" : "0x7f041e54a700", - "thread_info_addr" : "0x7f03f00008c0", - "thread_name" : "RequestBuilder ", - "ctx" : { - "IP" : "0x7f043038217f", - "SP" : "0x7f041e5494e0", - "BP" : "0x55fe80a30a80" - }, - "managed_frames" : [ - { - "native_address" : "unregistered" - } -, - { - "is_managed" : "true", - "guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", - "token" : "0x00000", - "native_offset" : "0x0", - "filename" : "mscorlib.dll", - "sizeofimage" : "0x456200", - "timestamp" : "0xb6a39772", - "il_offset" : "0x00000" - } -, - { - "is_managed" : "true", - "guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", - "token" : "0x60032a6", - "native_offset" : "0x0", - "filename" : "mscorlib.dll", - "sizeofimage" : "0x456200", - "timestamp" : "0xb6a39772", - "il_offset" : "0x000d9" - } -, - { - "is_managed" : "true", - "guid" : "F74B9F2F-EA8D-47A7-9227-26600E468191", - "token" : "0x6003af6", - "native_offset" : "0x0", - "filename" : "System.dll", - "sizeofimage" : "0x273600", - "timestamp" : "0xfe33b84b", - "il_offset" : "0x00067" - } -, - { - "is_managed" : "true", - "guid" : "F74B9F2F-EA8D-47A7-9227-26600E468191", - "token" : "0x60041ee", - "native_offset" : "0x0", - "filename" : "System.dll", - "sizeofimage" : "0x273600", - "timestamp" : "0xfe33b84b", - "il_offset" : "0x0004d" - } -, - { - "is_managed" : "true", - "guid" : "58F0218F-9887-43A4-8DD7-C84CBE933F4E", - "token" : "0x6001e72", - "native_offset" : "0x0", - "filename" : "Microsoft.Build.dll", - "sizeofimage" : "0x178c00", - "timestamp" : "0xa70665dd", - "il_offset" : "0x0002e" - } -, - { - "is_managed" : "true", - "guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", - "token" : "0x60033b4", - "native_offset" : "0x0", - "filename" : "mscorlib.dll", - "sizeofimage" : "0x456200", - "timestamp" : "0xb6a39772", - "il_offset" : "0xffffffff" - } -, - { - "is_managed" : "true", - "guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", - "token" : "0x60033b6", - "native_offset" : "0x0", - "filename" : "mscorlib.dll", - "sizeofimage" : "0x456200", - "timestamp" : "0xb6a39772", - "il_offset" : "0xffffffff" - } -, - { - "is_managed" : "true", - "guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", - "token" : "0x00000", - "native_offset" : "0x0", - "filename" : "mscorlib.dll", - "sizeofimage" : "0x456200", - "timestamp" : "0xb6a39772", - "il_offset" : "0x0004d" - } - - ], - "unmanaged_frames" : [ - { - "native_address" : "unregistered" - } -, - { - "native_address" : "unregistered" - } -, - { - "native_address" : "unregistered" - } -, - { - "native_address" : "unregistered" - } -, - { - "native_address" : "unregistered" - } -, - { - "native_address" : "unregistered" - } -, - { - "native_address" : "unregistered" - } -, - { - "native_address" : "unregistered" - } -, - { - "native_address" : "unregistered" - } -, - { - "native_address" : "unregistered" - } -, - { - "native_address" : "unregistered" - } - - ] -}, -{ - "is_managed" : false, - "offset_free_hash" : "0x0", - "offset_rich_hash" : "0x0", - "crashed" : false, - "native_thread_id" : "0x7f041da87700", - "thread_info_addr" : "0x7f03dc0008c0", - "thread_name" : "Thread Pool Wor", - "ctx" : { - "IP" : "0x7f0430384720", - "SP" : "0x7f041da86cc0", - "BP" : "(nil)" - }, - "unmanaged_frames" : [ - { - "native_address" : "unregistered" - } -, - { - "native_address" : "unregistered" - } -, - { - "native_address" : "unregistered" - } -, - { - "native_address" : "unregistered" - } -, - { - "native_address" : "unregistered" - } -, - { - "native_address" : "unregistered" - } -, - { - "native_address" : "unregistered" - } -, - { - "native_address" : "unregistered" - } -, - { - "native_address" : "unregistered" - } -, - { - "native_address" : "unregistered" - } -, - { - "native_address" : "unregistered" - } -, - { - "native_address" : "unregistered" - } - - ] -}, -{ - "is_managed" : false, - "offset_free_hash" : "0x0", - "offset_rich_hash" : "0x0", - "crashed" : false, - "native_thread_id" : "0x7f042c5e7700", - "thread_info_addr" : "0x7f04240008c0", - "thread_name" : "Thread Pool Wor", - "ctx" : { - "IP" : "0x7f0430384720", - "SP" : "0x7f042c5e6cc0", - "BP" : "(nil)" - }, - "unmanaged_frames" : [ - { - "native_address" : "unregistered" - } -, - { - "native_address" : "unregistered" - } -, - { - "native_address" : "unregistered" - } -, - { - "native_address" : "unregistered" - } -, - { - "native_address" : "unregistered" - } -, - { - "native_address" : "unregistered" - } -, - { - "native_address" : "unregistered" - } -, - { - "native_address" : "unregistered" - } -, - { - "native_address" : "unregistered" - } -, - { - "native_address" : "unregistered" - } -, - { - "native_address" : "unregistered" - } -, - { - "native_address" : "unregistered" - } - - ] -}, -{ - "is_managed" : false, - "offset_free_hash" : "0x0", - "offset_rich_hash" : "0x0", - "crashed" : false, - "native_thread_id" : "0x7f0430e99740", - "thread_info_addr" : "0x55fe80a33dd0", - "thread_name" : "mono", - "ctx" : { - "IP" : "0x7f043038217f", - "SP" : "0x7fff9c557ad0", - "BP" : "0x7fff9c557b30" - }, - "unmanaged_frames" : [ - { - "native_address" : "unregistered" - } -, - { - "native_address" : "unregistered" - } -, - { - "native_address" : "unregistered" - } -, - { - "native_address" : "unregistered" - } -, - { - "native_address" : "unregistered" - } -, - { - "native_address" : "unregistered" - } -, - { - "native_address" : "unregistered" - } -, - { - "native_address" : "unregistered" - } -, - { - "native_address" : "unregistered" - } -, - { - "native_address" : "unregistered" - } -, - { - "native_address" : "unregistered" - } -, - { - "native_address" : "unregistered" - } -, - { - "native_address" : "unregistered" - } -, - { - "native_address" : "unregistered" - } - - ] -}, -{ - "is_managed" : false, - "offset_free_hash" : "0x0", - "offset_rich_hash" : "0x0", - "crashed" : false, - "native_thread_id" : "0x7f041f562700", - "thread_info_addr" : "0x7f03fc0008c0", - "thread_name" : "Thread Pool Wor", - "ctx" : { - "IP" : "0x7f0430384720", - "SP" : "0x7f041f561cc0", - "BP" : "(nil)" - }, - "unmanaged_frames" : [ - { - "native_address" : "unregistered" - } -, - { - "native_address" : "unregistered" - } -, - { - "native_address" : "unregistered" - } -, - { - "native_address" : "unregistered" - } -, - { - "native_address" : "unregistered" - } -, - { - "native_address" : "unregistered" - } -, - { - "native_address" : "unregistered" - } -, - { - "native_address" : "unregistered" - } -, - { - "native_address" : "unregistered" - } -, - { - "native_address" : "unregistered" - } -, - { - "native_address" : "unregistered" - } -, - { - "native_address" : "unregistered" - } - - ] -}, -{ - "is_managed" : true, - "offset_free_hash" : "0x4b3aef62c", - "offset_rich_hash" : "0x4b3aef6c8", - "crashed" : false, - "native_thread_id" : "0x7f041ed03700", - "thread_info_addr" : "0x7f03f40008c0", - "thread_name" : "In-proc Node (D", - "ctx" : { - "IP" : "0x7f043038217f", - "SP" : "0x7f041ed02160", - "BP" : "0x55fe7fe69320" - }, - "managed_frames" : [ - { - "native_address" : "unregistered" - } -, - { - "is_managed" : "true", - "guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", - "token" : "0x00000", - "native_offset" : "0x0", - "filename" : "mscorlib.dll", - "sizeofimage" : "0x456200", - "timestamp" : "0xb6a39772", - "il_offset" : "0x0000b" - } -, - { - "is_managed" : "true", - "guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", - "token" : "0x60034e0", - "native_offset" : "0x0", - "filename" : "mscorlib.dll", - "sizeofimage" : "0x456200", - "timestamp" : "0xb6a39772", - "il_offset" : "0xffffffff" - } -, - { - "is_managed" : "true", - "guid" : "58F0218F-9887-43A4-8DD7-C84CBE933F4E", - "token" : "0x6000fbd", - "native_offset" : "0x0", - "filename" : "Microsoft.Build.dll", - "sizeofimage" : "0x178c00", - "timestamp" : "0xa70665dd", - "il_offset" : "0x00047" - } -, - { - "is_managed" : "true", - "guid" : "58F0218F-9887-43A4-8DD7-C84CBE933F4E", - "token" : "0x60011d0", - "native_offset" : "0x0", - "filename" : "Microsoft.Build.dll", - "sizeofimage" : "0x178c00", - "timestamp" : "0xa70665dd", - "il_offset" : "0x00000" - } -, - { - "is_managed" : "true", - "guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", - "token" : "0x60033b4", - "native_offset" : "0x0", - "filename" : "mscorlib.dll", - "sizeofimage" : "0x456200", - "timestamp" : "0xb6a39772", - "il_offset" : "0xffffffff" - } -, - { - "is_managed" : "true", - "guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", - "token" : "0x60033b6", - "native_offset" : "0x0", - "filename" : "mscorlib.dll", - "sizeofimage" : "0x456200", - "timestamp" : "0xb6a39772", - "il_offset" : "0xffffffff" - } -, - { - "is_managed" : "true", - "guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", - "token" : "0x00000", - "native_offset" : "0x0", - "filename" : "mscorlib.dll", - "sizeofimage" : "0x456200", - "timestamp" : "0xb6a39772", - "il_offset" : "0x0004d" - } - - ], -"unmanaged_frames" : [ -{ - "native_address" : "unregistered" - } -, -{ - "native_address" : "unregistered" - } -, -{ - "native_address" : "unregistered" - } -, -{ - "native_address" : "unregistered" - } -, -{ - "native_address" : "unregistered" - } -, -{ - "native_address" : "unregistered" - } -, -{ - "native_address" : "unregistered" - } -, -{ - "native_address" : "unregistered" - } -, -{ - "native_address" : "unregistered" - } -, -{ - "native_address" : "unregistered" - } -, -{ - "native_address" : "unregistered" - } - -] -}, -{ -"is_managed" : true, -"offset_free_hash" : "0x1adb36dd9e", -"offset_rich_hash" : "0x1adb36efb7", -"crashed" : true, -"native_thread_id" : "0x7f041c8d0700", -"thread_info_addr" : "0x7f03d40008c0", -"thread_name" : "RequestBuilder ", -"ctx" : { - "IP" : "0x55fe7f9a8dd0", - "SP" : "0x7f041c8cd5e0", - "BP" : "0x17568d6e" -}, -"managed_frames" : [ -{ - "native_address" : "unregistered" - } -, -{ - "is_managed" : "true", - "guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", - "token" : "0x00000", - "native_offset" : "0x0", - "filename" : "mscorlib.dll", - "sizeofimage" : "0x456200", - "timestamp" : "0xb6a39772", - "il_offset" : "0x0000b" - } -, -{ - "is_managed" : "true", - "guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", - "token" : "0x6004fd4", - "native_offset" : "0x0", - "filename" : "mscorlib.dll", - "sizeofimage" : "0x456200", - "timestamp" : "0xb6a39772", - "il_offset" : "0x00000" - } -, -{ - "is_managed" : "true", - "guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", - "token" : "0x6005138", - "native_offset" : "0x0", - "filename" : "mscorlib.dll", - "sizeofimage" : "0x456200", - "timestamp" : "0xb6a39772", - "il_offset" : "0xffffffff" - } -, -{ - "is_managed" : "true", - "guid" : "AB0ADFB7-DC4D-43DB-BBF0-DAB1C31A2209", - "token" : "0x600000c", - "native_offset" : "0x0", - "filename" : "Microsoft.NET.Build.Extensions.Tasks.dll", - "sizeofimage" : "0xf800", - "timestamp" : "0xb18e66fa", - "il_offset" : "0x00020" - } -, -{ - "is_managed" : "true", - "guid" : "AB0ADFB7-DC4D-43DB-BBF0-DAB1C31A2209", - "token" : "0x600000a", - "native_offset" : "0x0", - "filename" : "Microsoft.NET.Build.Extensions.Tasks.dll", - "sizeofimage" : "0xf800", - "timestamp" : "0xb18e66fa", - "il_offset" : "0x0001f" - } -, -{ - "is_managed" : "true", - "guid" : "AB0ADFB7-DC4D-43DB-BBF0-DAB1C31A2209", - "token" : "0x6000009", - "native_offset" : "0x0", - "filename" : "Microsoft.NET.Build.Extensions.Tasks.dll", - "sizeofimage" : "0xf800", - "timestamp" : "0xb18e66fa", - "il_offset" : "0x00000" - } -, -{ - "is_managed" : "true", - "guid" : "AB0ADFB7-DC4D-43DB-BBF0-DAB1C31A2209", - "token" : "0x600003c", - "native_offset" : "0x0", - "filename" : "Microsoft.NET.Build.Extensions.Tasks.dll", - "sizeofimage" : "0xf800", - "timestamp" : "0xb18e66fa", - "il_offset" : "0x00000" - } -, -{ - "is_managed" : "true", - "guid" : "58F0218F-9887-43A4-8DD7-C84CBE933F4E", - "token" : "0x600121a", - "native_offset" : "0x0", - "filename" : "Microsoft.Build.dll", - "sizeofimage" : "0x178c00", - "timestamp" : "0xa70665dd", - "il_offset" : "0x00029" - } -, -{ - "is_managed" : "true", - "guid" : "58F0218F-9887-43A4-8DD7-C84CBE933F4E", - "token" : "0x6001e9d", - "native_offset" : "0x0", - "filename" : "Microsoft.Build.dll", - "sizeofimage" : "0x178c00", - "timestamp" : "0xa70665dd", - "il_offset" : "0x001f6" - } -, -{ - "is_managed" : "true", - "guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", - "token" : "0x6004d36", - "native_offset" : "0x0", - "filename" : "mscorlib.dll", - "sizeofimage" : "0x456200", - "timestamp" : "0xb6a39772", - "il_offset" : "0x0002c" - } -, -{ - "is_managed" : "true", - "guid" : "58F0218F-9887-43A4-8DD7-C84CBE933F4E", - "token" : "0x60010c5", - "native_offset" : "0x0", - "filename" : "Microsoft.Build.dll", - "sizeofimage" : "0x178c00", - "timestamp" : "0xa70665dd", - "il_offset" : "0x0004d" - } -, -{ - "is_managed" : "true", - "guid" : "58F0218F-9887-43A4-8DD7-C84CBE933F4E", - "token" : "0x6001e9b", - "native_offset" : "0x0", - "filename" : "Microsoft.Build.dll", - "sizeofimage" : "0x178c00", - "timestamp" : "0xa70665dd", - "il_offset" : "0x00065" - } -, -{ - "is_managed" : "true", - "guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", - "token" : "0x6004d36", - "native_offset" : "0x0", - "filename" : "mscorlib.dll", - "sizeofimage" : "0x456200", - "timestamp" : "0xb6a39772", - "il_offset" : "0x0002c" - } -, -{ - "is_managed" : "true", - "guid" : "58F0218F-9887-43A4-8DD7-C84CBE933F4E", - "token" : "0x60010c3", - "native_offset" : "0x0", - "filename" : "Microsoft.Build.dll", - "sizeofimage" : "0x178c00", - "timestamp" : "0xa70665dd", - "il_offset" : "0x0004d" - } -, -{ - "is_managed" : "true", - "guid" : "58F0218F-9887-43A4-8DD7-C84CBE933F4E", - "token" : "0x6001e97", - "native_offset" : "0x0", - "filename" : "Microsoft.Build.dll", - "sizeofimage" : "0x178c00", - "timestamp" : "0xa70665dd", - "il_offset" : "0x0019d" - } -, -{ - "is_managed" : "true", - "guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", - "token" : "0x6004d36", - "native_offset" : "0x0", - "filename" : "mscorlib.dll", - "sizeofimage" : "0x456200", - "timestamp" : "0xb6a39772", - "il_offset" : "0x0002c" - } -, -{ - "is_managed" : "true", - "guid" : "58F0218F-9887-43A4-8DD7-C84CBE933F4E", - "token" : "0x60010be", - "native_offset" : "0x0", - "filename" : "Microsoft.Build.dll", - "sizeofimage" : "0x178c00", - "timestamp" : "0xa70665dd", - "il_offset" : "0x00044" - } -, -{ - "is_managed" : "true", - "guid" : "58F0218F-9887-43A4-8DD7-C84CBE933F4E", - "token" : "0x6001e95", - "native_offset" : "0x0", - "filename" : "Microsoft.Build.dll", - "sizeofimage" : "0x178c00", - "timestamp" : "0xa70665dd", - "il_offset" : "0x0015e" - } -, -{ - "is_managed" : "true", - "guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", - "token" : "0x6004d36", - "native_offset" : "0x0", - "filename" : "mscorlib.dll", - "sizeofimage" : "0x456200", - "timestamp" : "0xb6a39772", - "il_offset" : "0x0002c" - } -, -{ - "is_managed" : "true", - "guid" : "58F0218F-9887-43A4-8DD7-C84CBE933F4E", - "token" : "0x60010bd", - "native_offset" : "0x0", - "filename" : "Microsoft.Build.dll", - "sizeofimage" : "0x178c00", - "timestamp" : "0xa70665dd", - "il_offset" : "0x00033" - } -, -{ - "is_managed" : "true", - "guid" : "58F0218F-9887-43A4-8DD7-C84CBE933F4E", - "token" : "0x6001e93", - "native_offset" : "0x0", - "filename" : "Microsoft.Build.dll", - "sizeofimage" : "0x178c00", - "timestamp" : "0xa70665dd", - "il_offset" : "0x0018b" - } -, -{ - "is_managed" : "true", - "guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", - "token" : "0x6004d36", - "native_offset" : "0x0", - "filename" : "mscorlib.dll", - "sizeofimage" : "0x456200", - "timestamp" : "0xb6a39772", - "il_offset" : "0x0002c" - } -, -{ - "is_managed" : "true", - "guid" : "58F0218F-9887-43A4-8DD7-C84CBE933F4E", - "token" : "0x60010b8", - "native_offset" : "0x0", - "filename" : "Microsoft.Build.dll", - "sizeofimage" : "0x178c00", - "timestamp" : "0xa70665dd", - "il_offset" : "0x00068" - } -, -{ - "is_managed" : "true", - "guid" : "58F0218F-9887-43A4-8DD7-C84CBE933F4E", - "token" : "0x6001e91", - "native_offset" : "0x0", - "filename" : "Microsoft.Build.dll", - "sizeofimage" : "0x178c00", - "timestamp" : "0xa70665dd", - "il_offset" : "0x0005f" - } -, -{ - "is_managed" : "true", - "guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", - "token" : "0x6004d36", - "native_offset" : "0x0", - "filename" : "mscorlib.dll", - "sizeofimage" : "0x456200", - "timestamp" : "0xb6a39772", - "il_offset" : "0x0002c" - } -, -{ - "is_managed" : "true", - "guid" : "58F0218F-9887-43A4-8DD7-C84CBE933F4E", - "token" : "0x6001093", - "native_offset" : "0x0", - "filename" : "Microsoft.Build.dll", - "sizeofimage" : "0x178c00", - "timestamp" : "0xa70665dd", - "il_offset" : "0x0004d" - } -, -{ - "is_managed" : "true", - "guid" : "58F0218F-9887-43A4-8DD7-C84CBE933F4E", - "token" : "0x6001e8f", - "native_offset" : "0x0", - "filename" : "Microsoft.Build.dll", - "sizeofimage" : "0x178c00", - "timestamp" : "0xa70665dd", - "il_offset" : "0x002b7" - } -, -{ - "is_managed" : "true", - "guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", - "token" : "0x6004d2b", - "native_offset" : "0x0", - "filename" : "mscorlib.dll", - "sizeofimage" : "0x456200", - "timestamp" : "0xb6a39772", - "il_offset" : "0x0002c" - } -, -{ - "is_managed" : "true", - "guid" : "58F0218F-9887-43A4-8DD7-C84CBE933F4E", - "token" : "0x600108c", - "native_offset" : "0x0", - "filename" : "Microsoft.Build.dll", - "sizeofimage" : "0x178c00", - "timestamp" : "0xa70665dd", - "il_offset" : "0x00044" - } -, -{ - "is_managed" : "true", - "guid" : "58F0218F-9887-43A4-8DD7-C84CBE933F4E", - "token" : "0x6001e89", - "native_offset" : "0x0", - "filename" : "Microsoft.Build.dll", - "sizeofimage" : "0x178c00", - "timestamp" : "0xa70665dd", - "il_offset" : "0x00412" - } -, -{ - "is_managed" : "true", - "guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", - "token" : "0x6004d4f", - "native_offset" : "0x0", - "filename" : "mscorlib.dll", - "sizeofimage" : "0x456200", - "timestamp" : "0xb6a39772", - "il_offset" : "0xffffffff" - } -, -{ - "is_managed" : "true", - "guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", - "token" : "0x6004d4e", - "native_offset" : "0x0", - "filename" : "mscorlib.dll", - "sizeofimage" : "0x456200", - "timestamp" : "0xb6a39772", - "il_offset" : "0xffffffff" - } -, -{ - "is_managed" : "true", - "guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", - "token" : "0x60038e3", - "native_offset" : "0x0", - "filename" : "mscorlib.dll", - "sizeofimage" : "0x456200", - "timestamp" : "0xb6a39772", - "il_offset" : "0xffffffff" - } -, -{ - "is_managed" : "true", - "guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", - "token" : "0x6003829", - "native_offset" : "0x0", - "filename" : "mscorlib.dll", - "sizeofimage" : "0x456200", - "timestamp" : "0xb6a39772", - "il_offset" : "0xffffffff" - } -, -{ - "is_managed" : "true", - "guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", - "token" : "0x6003973", - "native_offset" : "0x0", - "filename" : "mscorlib.dll", - "sizeofimage" : "0x456200", - "timestamp" : "0xb6a39772", - "il_offset" : "0xffffffff" - } -, -{ - "is_managed" : "true", - "guid" : "58F0218F-9887-43A4-8DD7-C84CBE933F4E", - "token" : "0x6001e72", - "native_offset" : "0x0", - "filename" : "Microsoft.Build.dll", - "sizeofimage" : "0x178c00", - "timestamp" : "0xa70665dd", - "il_offset" : "0x0001a" - } -, -{ - "is_managed" : "true", - "guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", - "token" : "0x60033b4", - "native_offset" : "0x0", - "filename" : "mscorlib.dll", - "sizeofimage" : "0x456200", - "timestamp" : "0xb6a39772", - "il_offset" : "0xffffffff" - } -, -{ - "is_managed" : "true", - "guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", - "token" : "0x60033b6", - "native_offset" : "0x0", - "filename" : "mscorlib.dll", - "sizeofimage" : "0x456200", - "timestamp" : "0xb6a39772", - "il_offset" : "0xffffffff" - } -, -{ - "is_managed" : "true", - "guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", - "token" : "0x00000", - "native_offset" : "0x0", - "filename" : "mscorlib.dll", - "sizeofimage" : "0x456200", - "timestamp" : "0xb6a39772", - "il_offset" : "0x0004d" - } - -], -"unmanaged_frames" : [ -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} - -] -}, -{ -"is_managed" : false, -"offset_free_hash" : "0x0", -"offset_rich_hash" : "0x0", -"crashed" : false, -"native_thread_id" : "0x7f041e26f700", -"thread_info_addr" : "0x7f03e40008c0", -"thread_name" : "Thread Pool Wor", -"ctx" : { -"IP" : "0x7f0430384720", -"SP" : "0x7f041e26ecc0", -"BP" : "(nil)" -}, -"unmanaged_frames" : [ -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} - -] -}, -{ -"is_managed" : false, -"offset_free_hash" : "0x0", -"offset_rich_hash" : "0x0", -"crashed" : false, -"native_thread_id" : "0x7f041ffff700", -"thread_info_addr" : "0x7f04140008c0", -"thread_name" : "Thread Pool Wor", -"ctx" : { -"IP" : "0x7f0430384720", -"SP" : "0x7f041fffecc0", -"BP" : "(nil)" -}, -"unmanaged_frames" : [ -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} - -] -}, -{ -"is_managed" : false, -"offset_free_hash" : "0x0", -"offset_rich_hash" : "0x0", -"crashed" : false, -"native_thread_id" : "0x7f041fbfd700", -"thread_info_addr" : "0x7f04100008c0", -"thread_name" : "Thread Pool Wor", -"ctx" : { -"IP" : "0x7f0430384720", -"SP" : "0x7f041fbfccc0", -"BP" : "(nil)" -}, -"unmanaged_frames" : [ -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} - -] -}, -{ -"is_managed" : true, -"offset_free_hash" : "0x6fcdf94fa", -"offset_rich_hash" : "0x6fcdf975a", -"crashed" : false, -"native_thread_id" : "0x7f041f767700", -"thread_info_addr" : "0x7f04080008c0", -"thread_name" : "Thread Pool Wor", -"ctx" : { -"IP" : "0x7f043038217f", -"SP" : "0x7f041f765bf0", -"BP" : "0x55fe80a2b6f0" -}, -"managed_frames" : [ -{ -"native_address" : "unregistered" -} -, -{ -"is_managed" : "true", -"guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", -"token" : "0x00000", -"native_offset" : "0x0", -"filename" : "mscorlib.dll", -"sizeofimage" : "0x456200", -"timestamp" : "0xb6a39772", -"il_offset" : "0x0000b" -} -, -{ -"is_managed" : "true", -"guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", -"token" : "0x60034d0", -"native_offset" : "0x0", -"filename" : "mscorlib.dll", -"sizeofimage" : "0x456200", -"timestamp" : "0xb6a39772", -"il_offset" : "0xffffffff" -} -, -{ -"is_managed" : "true", -"guid" : "58F0218F-9887-43A4-8DD7-C84CBE933F4E", -"token" : "0x6000a3d", -"native_offset" : "0x0", -"filename" : "Microsoft.Build.dll", -"sizeofimage" : "0x178c00", -"timestamp" : "0xa70665dd", -"il_offset" : "0x00053" -} -, -{ -"is_managed" : "true", -"guid" : "58F0218F-9887-43A4-8DD7-C84CBE933F4E", -"token" : "0x600099c", -"native_offset" : "0x0", -"filename" : "Microsoft.Build.dll", -"sizeofimage" : "0x178c00", -"timestamp" : "0xa70665dd", -"il_offset" : "0x00008" -} -, -{ -"is_managed" : "true", -"guid" : "9D8E5B5A-2F29-465A-9F4A-FD51F8C7B0AE", -"token" : "0x60000a0", -"native_offset" : "0x0", -"filename" : "MonoDevelop.MSBuildBuilder.exe", -"sizeofimage" : "0xf600", -"timestamp" : "0xfd04a10b", -"il_offset" : "0x00065" -} -, -{ -"is_managed" : "true", -"guid" : "9D8E5B5A-2F29-465A-9F4A-FD51F8C7B0AE", -"token" : "0x6000178", -"native_offset" : "0x0", -"filename" : "MonoDevelop.MSBuildBuilder.exe", -"sizeofimage" : "0xf600", -"timestamp" : "0xfd04a10b", -"il_offset" : "0x0012f" -} -, -{ -"is_managed" : "true", -"guid" : "9D8E5B5A-2F29-465A-9F4A-FD51F8C7B0AE", -"token" : "0x6000085", -"native_offset" : "0x0", -"filename" : "MonoDevelop.MSBuildBuilder.exe", -"sizeofimage" : "0xf600", -"timestamp" : "0xfd04a10b", -"il_offset" : "0x0001c" -} -, -{ -"is_managed" : "true", -"guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", -"token" : "0x60033b4", -"native_offset" : "0x0", -"filename" : "mscorlib.dll", -"sizeofimage" : "0x456200", -"timestamp" : "0xb6a39772", -"il_offset" : "0xffffffff" -} -, -{ -"is_managed" : "true", -"guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", -"token" : "0x60033b6", -"native_offset" : "0x0", -"filename" : "mscorlib.dll", -"sizeofimage" : "0x456200", -"timestamp" : "0xb6a39772", -"il_offset" : "0xffffffff" -} -, -{ -"is_managed" : "true", -"guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", -"token" : "0x00000", -"native_offset" : "0x0", -"filename" : "mscorlib.dll", -"sizeofimage" : "0x456200", -"timestamp" : "0xb6a39772", -"il_offset" : "0x0004d" -} - -], -"unmanaged_frames" : [ -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} - -] -}, -{ -"is_managed" : false, -"offset_free_hash" : "0x0", -"offset_rich_hash" : "0x0", -"crashed" : false, -"native_thread_id" : "0x7f041e74b700", -"thread_info_addr" : "0x7f03ec0008c0", -"thread_name" : "Thread Pool Wor", -"ctx" : { -"IP" : "0x7f0430384720", -"SP" : "0x7f041e74acc0", -"BP" : "(nil)" -}, -"unmanaged_frames" : [ -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} - -] -}, -{ -"is_managed" : false, -"offset_free_hash" : "0x0", -"offset_rich_hash" : "0x0", -"crashed" : false, -"native_thread_id" : "0x7f042d3c9700", -"thread_info_addr" : "0x7f04280008c0", -"thread_name" : "Finalizer", -"ctx" : { -"IP" : "0x7f0430384556", -"SP" : "0x7f042d3c8d00", -"BP" : "(nil)" -}, -"unmanaged_frames" : [ -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} - -] -}, -{ -"is_managed" : true, -"offset_free_hash" : "0x549be692b", -"offset_rich_hash" : "0x549be6b31", -"crashed" : false, -"native_thread_id" : "0x7f041ecc2700", -"thread_info_addr" : "0x7f03f80008c0", -"thread_name" : "RequestBuilder ", -"ctx" : { -"IP" : "0x7f043038217f", -"SP" : "0x7f041ecc14e0", -"BP" : "0x55fe80a30bd0" -}, -"managed_frames" : [ -{ -"native_address" : "unregistered" -} -, -{ -"is_managed" : "true", -"guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", -"token" : "0x00000", -"native_offset" : "0x0", -"filename" : "mscorlib.dll", -"sizeofimage" : "0x456200", -"timestamp" : "0xb6a39772", -"il_offset" : "0x00000" -} -, -{ -"is_managed" : "true", -"guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", -"token" : "0x60032a6", -"native_offset" : "0x0", -"filename" : "mscorlib.dll", -"sizeofimage" : "0x456200", -"timestamp" : "0xb6a39772", -"il_offset" : "0x000d9" -} -, -{ -"is_managed" : "true", -"guid" : "F74B9F2F-EA8D-47A7-9227-26600E468191", -"token" : "0x6003af6", -"native_offset" : "0x0", -"filename" : "System.dll", -"sizeofimage" : "0x273600", -"timestamp" : "0xfe33b84b", -"il_offset" : "0x00067" -} -, -{ -"is_managed" : "true", -"guid" : "F74B9F2F-EA8D-47A7-9227-26600E468191", -"token" : "0x60041ee", -"native_offset" : "0x0", -"filename" : "System.dll", -"sizeofimage" : "0x273600", -"timestamp" : "0xfe33b84b", -"il_offset" : "0x0004d" -} -, -{ -"is_managed" : "true", -"guid" : "58F0218F-9887-43A4-8DD7-C84CBE933F4E", -"token" : "0x6001e72", -"native_offset" : "0x0", -"filename" : "Microsoft.Build.dll", -"sizeofimage" : "0x178c00", -"timestamp" : "0xa70665dd", -"il_offset" : "0x0002e" -} -, -{ -"is_managed" : "true", -"guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", -"token" : "0x60033b4", -"native_offset" : "0x0", -"filename" : "mscorlib.dll", -"sizeofimage" : "0x456200", -"timestamp" : "0xb6a39772", -"il_offset" : "0xffffffff" -} -, -{ -"is_managed" : "true", -"guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", -"token" : "0x60033b6", -"native_offset" : "0x0", -"filename" : "mscorlib.dll", -"sizeofimage" : "0x456200", -"timestamp" : "0xb6a39772", -"il_offset" : "0xffffffff" -} -, -{ -"is_managed" : "true", -"guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", -"token" : "0x00000", -"native_offset" : "0x0", -"filename" : "mscorlib.dll", -"sizeofimage" : "0x456200", -"timestamp" : "0xb6a39772", -"il_offset" : "0x0004d" -} - -], -"unmanaged_frames" : [ -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} - -] -}, -{ -"is_managed" : true, -"offset_free_hash" : "0x689d0ba21", -"offset_rich_hash" : "0x689d0bb59", -"crashed" : false, -"native_thread_id" : "0x7f042c7e8700", -"thread_info_addr" : "0x7f04200008c0", -"thread_name" : "mono", -"ctx" : { -"IP" : "0x7f0430385593", -"SP" : "0x7f042c7e75b0", -"BP" : "(nil)" -}, -"managed_frames" : [ -{ -"native_address" : "unregistered" -} -, -{ -"is_managed" : "true", -"guid" : "F74B9F2F-EA8D-47A7-9227-26600E468191", -"token" : "0x00000", -"native_offset" : "0x0", -"filename" : "System.dll", -"sizeofimage" : "0x273600", -"timestamp" : "0xfe33b84b", -"il_offset" : "0x0000b" -} -, -{ -"is_managed" : "true", -"guid" : "F74B9F2F-EA8D-47A7-9227-26600E468191", -"token" : "0x60020fa", -"native_offset" : "0x0", -"filename" : "System.dll", -"sizeofimage" : "0x273600", -"timestamp" : "0xfe33b84b", -"il_offset" : "0x0000c" -} -, -{ -"is_managed" : "true", -"guid" : "F74B9F2F-EA8D-47A7-9227-26600E468191", -"token" : "0x60020f1", -"native_offset" : "0x0", -"filename" : "System.dll", -"sizeofimage" : "0x273600", -"timestamp" : "0xfe33b84b", -"il_offset" : "0x0002e" -} -, -{ -"is_managed" : "true", -"guid" : "F74B9F2F-EA8D-47A7-9227-26600E468191", -"token" : "0x600208c", -"native_offset" : "0x0", -"filename" : "System.dll", -"sizeofimage" : "0x273600", -"timestamp" : "0xfe33b84b", -"il_offset" : "0x00000" -} -, -{ -"is_managed" : "true", -"guid" : "F74B9F2F-EA8D-47A7-9227-26600E468191", -"token" : "0x6002049", -"native_offset" : "0x0", -"filename" : "System.dll", -"sizeofimage" : "0x273600", -"timestamp" : "0xfe33b84b", -"il_offset" : "0x0009b" -} -, -{ -"is_managed" : "true", -"guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", -"token" : "0x6002dd4", -"native_offset" : "0x0", -"filename" : "mscorlib.dll", -"sizeofimage" : "0x456200", -"timestamp" : "0xb6a39772", -"il_offset" : "0xffffffff" -} -, -{ -"is_managed" : "true", -"guid" : "9D8E5B5A-2F29-465A-9F4A-FD51F8C7B0AE", -"token" : "0x600005d", -"native_offset" : "0x0", -"filename" : "MonoDevelop.MSBuildBuilder.exe", -"sizeofimage" : "0xf600", -"timestamp" : "0xfd04a10b", -"il_offset" : "0x0000e" -} -, -{ -"is_managed" : "true", -"guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", -"token" : "0x60033b4", -"native_offset" : "0x0", -"filename" : "mscorlib.dll", -"sizeofimage" : "0x456200", -"timestamp" : "0xb6a39772", -"il_offset" : "0xffffffff" -} -, -{ -"is_managed" : "true", -"guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", -"token" : "0x60033b6", -"native_offset" : "0x0", -"filename" : "mscorlib.dll", -"sizeofimage" : "0x456200", -"timestamp" : "0xb6a39772", -"il_offset" : "0xffffffff" -} -, -{ -"is_managed" : "true", -"guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", -"token" : "0x00000", -"native_offset" : "0x0", -"filename" : "mscorlib.dll", -"sizeofimage" : "0x456200", -"timestamp" : "0xb6a39772", -"il_offset" : "0x0004d" -} - -], -"unmanaged_frames" : [ -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} - -] -}, -{ -"is_managed" : true, -"offset_free_hash" : "0xad9e3d583", -"offset_rich_hash" : "0xad9e3d810", -"crashed" : false, -"native_thread_id" : "0x7f041dd0b700", -"thread_info_addr" : "0x7f03e80008c0", -"thread_name" : "Thread Pool Wor", -"ctx" : { -"IP" : "0x7f043038217f", -"SP" : "0x7f041dd096f0", -"BP" : "0x55fe80a2b680" -}, -"managed_frames" : [ -{ -"native_address" : "unregistered" -} -, -{ -"is_managed" : "true", -"guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", -"token" : "0x00000", -"native_offset" : "0x0", -"filename" : "mscorlib.dll", -"sizeofimage" : "0x456200", -"timestamp" : "0xb6a39772", -"il_offset" : "0x0000b" -} -, -{ -"is_managed" : "true", -"guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", -"token" : "0x60034d0", -"native_offset" : "0x0", -"filename" : "mscorlib.dll", -"sizeofimage" : "0x456200", -"timestamp" : "0xb6a39772", -"il_offset" : "0xffffffff" -} -, -{ -"is_managed" : "true", -"guid" : "9D8E5B5A-2F29-465A-9F4A-FD51F8C7B0AE", -"token" : "0x6000084", -"native_offset" : "0x0", -"filename" : "MonoDevelop.MSBuildBuilder.exe", -"sizeofimage" : "0xf600", -"timestamp" : "0xfd04a10b", -"il_offset" : "0x000ef" -} -, -{ -"is_managed" : "true", -"guid" : "9D8E5B5A-2F29-465A-9F4A-FD51F8C7B0AE", -"token" : "0x600009d", -"native_offset" : "0x0", -"filename" : "MonoDevelop.MSBuildBuilder.exe", -"sizeofimage" : "0xf600", -"timestamp" : "0xfd04a10b", -"il_offset" : "0x0006e" -} -, -{ -"is_managed" : "true", -"guid" : "9D8E5B5A-2F29-465A-9F4A-FD51F8C7B0AE", -"token" : "0x600007b", -"native_offset" : "0x0", -"filename" : "MonoDevelop.MSBuildBuilder.exe", -"sizeofimage" : "0xf600", -"timestamp" : "0xfd04a10b", -"il_offset" : "0x0006d" -} -, -{ -"is_managed" : "true", -"guid" : "9D8E5B5A-2F29-465A-9F4A-FD51F8C7B0AE", -"token" : "0x00000", -"native_offset" : "0x0", -"filename" : "MonoDevelop.MSBuildBuilder.exe", -"sizeofimage" : "0xf600", -"timestamp" : "0xfd04a10b", -"il_offset" : "0x00050" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"is_managed" : "true", -"guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", -"token" : "0x00000", -"native_offset" : "0x0", -"filename" : "mscorlib.dll", -"sizeofimage" : "0x456200", -"timestamp" : "0xb6a39772", -"il_offset" : "0x0000c" -} -, -{ -"is_managed" : "true", -"guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", -"token" : "0x6004ecc", -"native_offset" : "0x0", -"filename" : "mscorlib.dll", -"sizeofimage" : "0x456200", -"timestamp" : "0xb6a39772", -"il_offset" : "0xffffffff" -} -, -{ -"is_managed" : "true", -"guid" : "9D8E5B5A-2F29-465A-9F4A-FD51F8C7B0AE", -"token" : "0x6000039", -"native_offset" : "0x0", -"filename" : "MonoDevelop.MSBuildBuilder.exe", -"sizeofimage" : "0xf600", -"timestamp" : "0xfd04a10b", -"il_offset" : "0x00019" -} -, -{ -"is_managed" : "true", -"guid" : "9D8E5B5A-2F29-465A-9F4A-FD51F8C7B0AE", -"token" : "0x6000166", -"native_offset" : "0x0", -"filename" : "MonoDevelop.MSBuildBuilder.exe", -"sizeofimage" : "0xf600", -"timestamp" : "0xfd04a10b", -"il_offset" : "0x00029" -} -, -{ -"is_managed" : "true", -"guid" : "9D8E5B5A-2F29-465A-9F4A-FD51F8C7B0AE", -"token" : "0x6000181", -"native_offset" : "0x0", -"filename" : "MonoDevelop.MSBuildBuilder.exe", -"sizeofimage" : "0xf600", -"timestamp" : "0xfd04a10b", -"il_offset" : "0x00001" -} -, -{ -"is_managed" : "true", -"guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", -"token" : "0x600347e", -"native_offset" : "0x0", -"filename" : "mscorlib.dll", -"sizeofimage" : "0x456200", -"timestamp" : "0xb6a39772", -"il_offset" : "0xffffffff" -} -, -{ -"is_managed" : "true", -"guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", -"token" : "0x600347c", -"native_offset" : "0x0", -"filename" : "mscorlib.dll", -"sizeofimage" : "0x456200", -"timestamp" : "0xb6a39772", -"il_offset" : "0xffffffff" -} -, -{ -"is_managed" : "true", -"guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", -"token" : "0x6003478", -"native_offset" : "0x0", -"filename" : "mscorlib.dll", -"sizeofimage" : "0x456200", -"timestamp" : "0xb6a39772", -"il_offset" : "0xffffffff" -} -, -{ -"is_managed" : "true", -"guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", -"token" : "0x00000", -"native_offset" : "0x0", -"filename" : "mscorlib.dll", -"sizeofimage" : "0x456200", -"timestamp" : "0xb6a39772", -"il_offset" : "0x0001e" -} - -], -"unmanaged_frames" : [ -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} - -] -}, -{ -"is_managed" : false, -"offset_free_hash" : "0x0", -"offset_rich_hash" : "0x0", -"crashed" : false, -"native_thread_id" : "0x7f03dbdfe700", -"thread_info_addr" : "0x7f03c80008c0", -"thread_name" : "mono", -"ctx" : { -"IP" : "0x7f0430382528", -"SP" : "0x7f03dbdfdca0", -"BP" : "0x55fe7fe78fe0" -}, -"unmanaged_frames" : [ -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} - -] -}, -{ -"is_managed" : false, -"offset_free_hash" : "0x0", -"offset_rich_hash" : "0x0", -"crashed" : false, -"native_thread_id" : "0x7f041cffb700", -"thread_info_addr" : "0x7f03e00008c0", -"thread_name" : "Thread Pool Wor", -"ctx" : { -"IP" : "0x7f0430384720", -"SP" : "0x7f041cffacc0", -"BP" : "(nil)" -}, -"unmanaged_frames" : [ -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} - -] -}, -{ -"is_managed" : true, -"offset_free_hash" : "0x438d78b5a", -"offset_rich_hash" : "0x438d78bb3", -"crashed" : false, -"native_thread_id" : "0x7f041fdfe700", -"thread_info_addr" : "0x7f040c0008c0", -"thread_name" : "Thread Pool Wor", -"ctx" : { -"IP" : "0x7f0430382528", -"SP" : "0x7f041fdfd860", -"BP" : "0x55fe7fe78fe0" -}, -"managed_frames" : [ -{ -"native_address" : "unregistered" -} -, -{ -"is_managed" : "true", -"guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", -"token" : "0x00000", -"native_offset" : "0x0", -"filename" : "mscorlib.dll", -"sizeofimage" : "0x456200", -"timestamp" : "0xb6a39772", -"il_offset" : "0x0000b" -} -, -{ -"is_managed" : "true", -"guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", -"token" : "0x60033da", -"native_offset" : "0x0", -"filename" : "mscorlib.dll", -"sizeofimage" : "0x456200", -"timestamp" : "0xb6a39772", -"il_offset" : "0xffffffff" -} -, -{ -"is_managed" : "true", -"guid" : "9D8E5B5A-2F29-465A-9F4A-FD51F8C7B0AE", -"token" : "0x6000176", -"native_offset" : "0x0", -"filename" : "MonoDevelop.MSBuildBuilder.exe", -"sizeofimage" : "0xf600", -"timestamp" : "0xfd04a10b", -"il_offset" : "0x00004" -} -, -{ -"is_managed" : "true", -"guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", -"token" : "0x60033b4", -"native_offset" : "0x0", -"filename" : "mscorlib.dll", -"sizeofimage" : "0x456200", -"timestamp" : "0xb6a39772", -"il_offset" : "0xffffffff" -} -, -{ -"is_managed" : "true", -"guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", -"token" : "0x60033b6", -"native_offset" : "0x0", -"filename" : "mscorlib.dll", -"sizeofimage" : "0x456200", -"timestamp" : "0xb6a39772", -"il_offset" : "0xffffffff" -} -, -{ -"is_managed" : "true", -"guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", -"token" : "0x00000", -"native_offset" : "0x0", -"filename" : "mscorlib.dll", -"sizeofimage" : "0x456200", -"timestamp" : "0xb6a39772", -"il_offset" : "0x0004d" -} - -], -"unmanaged_frames" : [ -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} - -] -}, -{ -"is_managed" : true, -"offset_free_hash" : "0x42955ac23", -"offset_rich_hash" : "0x42955ac77", -"crashed" : false, -"native_thread_id" : "0x7f041f9b2700", -"thread_info_addr" : "0x7f04040008c0", -"thread_name" : "Timer-Scheduler", -"ctx" : { -"IP" : "0x7f0430382528", -"SP" : "0x7f041f9b11c0", -"BP" : "0x55fe80a2a7a0" -}, -"managed_frames" : [ -{ -"native_address" : "unregistered" -} -, -{ -"is_managed" : "true", -"guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", -"token" : "0x00000", -"native_offset" : "0x0", -"filename" : "mscorlib.dll", -"sizeofimage" : "0x456200", -"timestamp" : "0xb6a39772", -"il_offset" : "0x0000b" -} -, -{ -"is_managed" : "true", -"guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", -"token" : "0x60034d0", -"native_offset" : "0x0", -"filename" : "mscorlib.dll", -"sizeofimage" : "0x456200", -"timestamp" : "0xb6a39772", -"il_offset" : "0xffffffff" -} -, -{ -"is_managed" : "true", -"guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", -"token" : "0x600358b", -"native_offset" : "0x0", -"filename" : "mscorlib.dll", -"sizeofimage" : "0x456200", -"timestamp" : "0xb6a39772", -"il_offset" : "0xffffffff" -} -, -{ -"is_managed" : "true", -"guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", -"token" : "0x60033b4", -"native_offset" : "0x0", -"filename" : "mscorlib.dll", -"sizeofimage" : "0x456200", -"timestamp" : "0xb6a39772", -"il_offset" : "0xffffffff" -} -, -{ -"is_managed" : "true", -"guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", -"token" : "0x60033b6", -"native_offset" : "0x0", -"filename" : "mscorlib.dll", -"sizeofimage" : "0x456200", -"timestamp" : "0xb6a39772", -"il_offset" : "0xffffffff" -} -, -{ -"is_managed" : "true", -"guid" : "B0FBCE3A-DED2-4CD6-9A27-94DF353EBD0A", -"token" : "0x00000", -"native_offset" : "0x0", -"filename" : "mscorlib.dll", -"sizeofimage" : "0x456200", -"timestamp" : "0xb6a39772", -"il_offset" : "0x0004d" -} - -], -"unmanaged_frames" : [ -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} -, -{ -"native_address" : "unregistered" -} - -] -} -] -} \ No newline at end of file diff --git a/services/CheckService.cs b/services/CheckService.cs new file mode 100644 index 0000000..b79ba54 --- /dev/null +++ b/services/CheckService.cs @@ -0,0 +1,65 @@ +using System; +using ln.application; +using System.Threading; +using ln.logging; +using ln.application.service; +namespace ln.skyscanner.services +{ + public class CheckService : ApplicationServiceBase + { + public CheckService() + :base("Check Service") + { + DependOnService(); + } + + public override void ServiceMain(IApplicationInterface applicationInterface) + { + long nextMinute = DateTimeOffset.Now.ToUnixTimeMilliseconds(); + + while (!StopRequested) + { + /* + List checkJobs = new List(); + + Logging.Log(LogLevel.INFO, "SkyChecker.scheduler(): scheduler save CheckStates"); + + lock (saveQueue) + { + foreach (SkyCheckState checkState in saveQueue) + { + SkyScanner.Instance.Entities.SkyCheckStates.Upsert(checkState); + } + saveQueue.Clear(); + } + + Logging.Log(LogLevel.INFO, "SkyChecker.scheduler(): scheduler starts"); + + foreach (Node node in SkyScanner.Instance.Entities.NodeCollection) + { + CheckJob checkJob = new CheckJob(node); + checkJobs.Add(checkJob); + } + Logging.Log(LogLevel.INFO, "SkyChecker.scheduler(): prepared {0} checks", checkJobs.Count); + Logging.Log(LogLevel.INFO, "SkyChecker.scheduler(): scheduled {0} checks", checkPool.Enqueue(checkJobs)); + */ + + while (true) + { + while ((nextMinute - DateTimeOffset.Now.ToUnixTimeMilliseconds()) < 0) + nextMinute += 60000; + + try + { + Thread.Sleep((int)(nextMinute - DateTimeOffset.Now.ToUnixTimeMilliseconds())); + } catch (ThreadInterruptedException) + { + Logging.Log(LogLevel.INFO, "CheckService: scheduler was interrupted"); + if (StopRequested) + break; + } + } + } + } + } +} diff --git a/services/CrawlService.cs b/services/CrawlService.cs new file mode 100644 index 0000000..361eb6f --- /dev/null +++ b/services/CrawlService.cs @@ -0,0 +1,18 @@ +using System; +using ln.application; +using ln.application.service; +namespace ln.skyscanner.services +{ + public class CrawlService : ApplicationServiceBase + { + public CrawlService() + :base("Crawler Service") + { + DependOnService(); + } + + public override void ServiceMain(IApplicationInterface applicationInterface) + { + } + } +} diff --git a/services/EntityService.cs b/services/EntityService.cs new file mode 100644 index 0000000..6939d04 --- /dev/null +++ b/services/EntityService.cs @@ -0,0 +1,92 @@ +using System; +using ln.application; +using ln.application.service; +using System.Threading; +using System.IO; +using ln.types.odb; +using ln.types.odb.mapped; +using ln.skyscanner.entities; +using ln.skyscanner.crawl; +using ln.types.net; +using ln.skyscanner.checks; +using ln.logging; +namespace ln.skyscanner.services +{ + public class EntityService : ApplicationServiceBase + { + public string BasePath { get; private set; } + + public ODB ODB { get; private set; } + + public ODBCollection NodeCollection { get; private set; } + public ODBCollection SubnetCollection { get; private set; } + + public ODBCollection PointOfPresenceCollection { get; private set; } + public ODBCollection L2SegmentCollection { get; private set; } + + public ODBCollection CrawledHosts { get; private set; } + public ODBCollection CrawledSubnets { get; private set; } + + public ODBCollection BlockedNetworks { get; private set; } + + public ODBCollection SkyCheckStates { get; private set; } + + + + public EntityService() + :base("Entity Service") + { + } + + public override void ServiceMain(IApplicationInterface applicationInterface) + { + BasePath = Path.Combine( + CurrentApplicationInterface.Arguments["base-path"].Value, + "entities" + ); + + Logging.Log(LogLevel.INFO, "Entity Service: Initializing"); + + ODB = new ODB(BasePath); + + NodeCollection = ODB.GetCollection(); + NodeCollection.EnableStrongCache(true); + NodeCollection.EnsureIndex("uniqueIdentity", true); + NodeCollection.EnsureIndeces( + "PrimaryIP", + "Interfaces[].ConfiguredIPs[].IP", + "Interfaces[].ConfiguredIPs[].Network" + ); + + SubnetCollection = ODB.GetCollection(); + SubnetCollection.EnsureIndeces("Network"); + + PointOfPresenceCollection = ODB.GetCollection(); + PointOfPresenceCollection.EnsureIndeces("ForeignName"); + + L2SegmentCollection = ODB.GetCollection(); + L2SegmentCollection.EnsureIndeces("Network", "PoPs"); + + CrawledHosts = ODB.GetCollection(); + CrawledHosts.EnsureIndeces("PrimaryIP", "IPAddresses[]"); + + CrawledSubnets = ODB.GetCollection(); + BlockedNetworks = ODB.GetCollection("blockedNetworks"); + + SkyCheckStates = ODB.GetCollection(); + SkyCheckStates.EnableStrongCache(true); + SkyCheckStates.EnsureIndeces("Node"); + SkyCheckStates.EnsureUniqueness("Node", "CheckName"); + + + + lock (Thread.CurrentThread) + { + Monitor.Wait(Thread.CurrentThread); + } + + BasePath = null; + } + + } +} diff --git a/templates/static/checks/node.html b/templates/static/checks/node.html index 4d08b6e..0090b80 100644 --- a/templates/static/checks/node.html +++ b/templates/static/checks/node.html @@ -135,55 +135,59 @@ { var chartColor = performanceValue.CheckState == "CRITICAL" ? '#FF0000' : (performanceValue.CheckState == "WARN") ? '#C0C000' : '#000000'; var htmlChart = $("canvas", graphDiv); - - var chart = new Chart( htmlChart, { - type: 'bar', - data: { - datasets: [ - { - label: "-", - data: [], - backgroundColor: chartColor, - } - ] - }, - options: { - scales: { - yAxes: [ + var chart = htmlChart.data("chart"); + + if (!chart){ + chart = new Chart( htmlChart, { + type: 'bar', + data: { + datasets: [ { - ticks: { - callback: ScaleSI, - beginAtZero: true, - } + label: "-", + data: [], + backgroundColor: chartColor, } - ], - xAxes: [{ - type: 'time', - time: { - unit: "minute", - tooltipFormat: "DD.MM.YYYY HH:mm", - displayFormats: { - minute: "DD.MM.YYYY HH:mm" - }, - parser: moment.unix - } - }] + ] }, - responsive: true, - maintainAspectRatio: false - } - } ); - + options: { + scales: { + yAxes: [ + { + ticks: { + callback: ScaleSI, + beginAtZero: true, + } + } + ], + xAxes: [{ + type: 'time', + time: { + unit: "minute", + tooltipFormat: "DD.MM.YYYY HH:mm", + displayFormats: { + minute: "DD.MM.YYYY HH:mm" + }, + parser: moment.unix + } + }] + }, + responsive: true, + maintainAspectRatio: false + } + } ); + } + chart.data.labels.length = 0; chart.data.datasets[0].data.length = 0; chart.data.datasets[0].label = performanceValue.PerfName; - $("#chart", htmlChart).data("chart", chart); + htmlChart.data("chart", chart); $.each( perfData, function(){ if (this.TimeStamp != 0) chart.data.datasets[0].data.push( { x: this.TimeStamp, y: this.Value } ); }); + graphDiv.prependTo( $("#graphs") ); chart.update(); } diff --git a/templates/static/css/style.css b/templates/static/css/style.css index c114f3f..e6946d5 100644 --- a/templates/static/css/style.css +++ b/templates/static/css/style.css @@ -61,7 +61,6 @@ table > thead { } table > tbody { - font-style: italic; } table td { diff --git a/templates/static/frame.html b/templates/static/frame.html index 69b47ae..0c76048 100644 --- a/templates/static/frame.html +++ b/templates/static/frame.html @@ -11,7 +11,8 @@ - + + @@ -22,7 +23,9 @@
diff --git a/templates/static/ln.application.js b/templates/static/ln.application.js new file mode 100644 index 0000000..d8988b5 --- /dev/null +++ b/templates/static/ln.application.js @@ -0,0 +1,335 @@ +var LN = (function(){ + var appInterface; + + var defaultOptions = { + url: null, + + }; + + class LNInterface { + constructor(opt){ + var self = this; + + this.options = {} + Object.assign(this.options,opt); + + if (this.options.url == null) + this.options.url = this.constructURL(); + + + this.rpcCallbacks = []; + this.rpcNextID = 1; + + this.websocket = new WebSocket(this.options.url); + this.websocket.onerror = function(e){ + alert("WebSocket caught error: " + e.date); + } + this.websocket.onmessage = function(e){ + var j = JSON.parse(e.data); + if (j.state){ + updateState(j.state); + } else if (j.id) + { + for (var n=0;n 1000000000) + return ((value / 1000000000) | 0) + "G"; + if (value > 1000000) + return ((value / 1000000) | 0) + "M"; + if (value > 1000) + return ((value / 1000) | 0) + "k"; + return value; +} + + +*/ + diff --git a/templates/static/skyapi.js b/templates/static/skyapi.js index 133b44d..f1e15af 100644 --- a/templates/static/skyapi.js +++ b/templates/static/skyapi.js @@ -11,11 +11,43 @@ function encodeID( t ) return ("" + t).replace( /[\.\/]/g, "_"); } +var lagDetector = null; + +function updateState(state) +{ + try + { + if (lagDetector) + clearTimeout(lagDetector); + + $("#ServerTime").text("ServerTime: " + moment(state.currentTime).format()); + + lagDetector = setTimeout(function(){ + $("#ServerTime").text("Server lag detected"); + }, 2000); + + } catch (e) + { + $("#ServerTime").text("Server state unexpected!"); + } +} + function SKYAPI(baseurl){ this.baseurl = baseurl; this.refresh = [] +/* this.websocket = new WebSocket("ws://localhost:8080/socket"); + this.websocket.onerror = function(e){ + alert("WebSocket Error: " + e); + } + this.websocket.onmessage = function(e){ + var j = JSON.parse(e.data); + if (j.state){ + updateState(j.state); + } + } +*/ this.setBaseURL = function(url){ this.baseurl = url; } this.addRefresh = function( rh, seconds = null ){ this.refresh.push( { interval: seconds ? seconds : 5, refresh: rh } ); }