예제 #1
0
        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());
        }
예제 #2
0
        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);
        }