25 #define DISCOVERY_SUBCLASS
45 return self->_instancename;
62 static GHashTable * _discovery_timers = NULL;
69 char * instancename =
self->_instancename;
71 if (self->_timerid > 0) {
72 g_source_remove(self->_timerid);
78 if (_discovery_timers && instancename) {
79 self->_instancename = NULL;
80 g_hash_table_remove(_discovery_timers, instancename);
84 self->_instancename = instancename = NULL;
109 return self->discover(
self);
124 g_return_val_if_fail(ret != NULL, NULL);
149 if (NULL == _discovery_timers) {
150 _discovery_timers = g_hash_table_new_full(g_str_hash, g_str_equal
152 assert(_discovery_timers != NULL);
154 self->discover(
self);
155 timeout =
self->discoverintervalsecs(
self);
160 g_hash_table_replace(_discovery_timers, self->instancename(
self),
self);
165 if (_discovery_timers) {
166 g_hash_table_remove(_discovery_timers, instance);
174 if (_discovery_timers != NULL) {
175 GHashTable* timers = _discovery_timers;
176 _discovery_timers = NULL;
177 g_hash_table_remove_all(timers);
178 g_hash_table_destroy(timers); timers = NULL;