private void HostRemoved(ServiceDirectory directory, ServiceEntry entry) { RuntimeMonitor.Monitor.RegisterCall("HostRemoved"); using (var client = new DatabaseClient()) client.RemoveByName(ServiceEntryToName(entry)); Logger.Log("Host removed: {0}", entry.ToShortString()); }
private async Task HostDiscovered(ServiceDirectory directory, ServiceEntry entry, bool fromUpdate = false) { RuntimeMonitor.Monitor.RegisterCall("HostDiscovered"); Logger.Log("Host discovered: {0}{1}", entry.ToShortString(), fromUpdate ? " from HostUpdated event" : ""); LampClient newClient = new LampClient(ServiceEntryToUrl(entry), ServiceEntryToName(entry)); // Get status and add to DB await GetLampStatus(newClient); UpdateDb(newClient); }