}
#endif
-void slp_service_agent::unregister()
+void slp_service_agent::unregister(Boolean stopListener)
{
if (_initialized.get() == 0 )
{
throw UninitializedObjectException();
}
- if (_should_listen.get())
+ if (stopListener && _should_listen.get())
{
_should_listen = 0;
#ifdef PEGASUS_SLP_REG_TIMEOUT
&callbackErr);
SLPClose(slp_handle);
}
-#elif PEGASUS_SLP_REG_TIMEOUT
+#else
// Unregister with external SLP SA.
sa_reg_params *p;
// semaphore is signalled means we have to update registrations.
else if (agent->_should_listen.get())
{
+ agent->unregister(false);
agent->update_registrations();
}
}
_LSLP_SLEEP(1);
if (agent->_update_reg_count.get() && agent->_should_listen.get())
{
+ agent->unregister(false);
agent->update_registrations();
agent->_update_reg_count--;
}