//---------------------------------------------------------------------------------------- // reset // ---------------------------------------------------------------------------------------- void SimRunner::reset ( ) { //reset all the parameter to the "unset" state list<ParamSet*>::iterator current_paramset = this->_allParams.begin(); while(current_paramset != this->_allParams.end()) { (*current_paramset)->reset(); current_paramset++; } reset_services(); }
/* Called whenever the client or server state changes */ static void client_callback(AvahiClient *c, AvahiClientState state, void *userdata) { struct runtime_data *r = userdata; ap_assert(r); r->client = c; /* ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->main_server, "client_callback(%u)", state); */ switch (state) { case AVAHI_CLIENT_S_RUNNING: create_all_services(r); break; case AVAHI_CLIENT_S_COLLISION: reset_services(r); break; case AVAHI_CLIENT_FAILURE: if (avahi_client_errno(c) == AVAHI_ERR_DISCONNECTED) { int error; free_services(r); avahi_client_free(r->client); if ((r->client = avahi_client_new(avahi_simple_poll_get(r->simple_poll), AVAHI_CLIENT_NO_FAIL, client_callback, r, &error))) break; ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->main_server, "avahi_client_new() failed: %s", avahi_strerror(error)); } else ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->main_server, "Client failure: %s", avahi_strerror(avahi_client_errno(c))); avahi_simple_poll_quit(r->simple_poll); break; case AVAHI_CLIENT_S_REGISTERING: case AVAHI_CLIENT_CONNECTING: /* do nothing */ break; } }