On May 19, 2008, at 11:23 AM, Martin Drasar wrote: > Hello everyone, > I have two problems related to shutting down sofia stack. > > In my application I create a separate thread that does the stack > initialization and runs the event loop. That's how I do it: > > su_init(); > su_root_create(instance->root); > nua_create(instance->root, ...); <- this is where the > su_pthread_port_clone_main is started > nua_set_params(); > while (true) > { > su_root_step (instance->root, 100); > if (terminate) > { > event->reset(); > nua_shutdown(instance->nua); > su_root_step(instance->root, 500); > event->wait(500); > nua_destroy(instance->nua); > break; > } > } > su_root_destroy (instance->root); > su_deinit(); > > Problem 1) > When the stack should end, I run that ugly piece of code, that calls > nua_sutdown(), does su_root_step() to receive the nua_r_shutdown event > and then calls nua_destroy(). However, even if I receive the > nua_r_shutdown event, nua_destroy() reports: FATAL: nua_shutdown not > completed. > What is the clean way to handle this? And what else is needed for > nua_shutdown() to be successfull?
You can/will get several status 101 r_shutdown events, you must wait for a status >=200. > > > Problem 2) > After calling the su_root_destroy() and su_deinit() the > su_pthread_port_clone_main is still running and waiting inside > su_wait() > function. This leads to access violations whenever I try to unload > sofia > library before shutting down the program. > su_root_destroy() documentation states that I should not call it from > cloned task. Is this the case? And if not, why does it fails to stop > the > thread? See problem 1, I think this is related. Mike > > > Any help is much appreciated > Thanks in advance > > Martin > > -- > Martin Drasar, Developer / Analyst > OptimSys, s.r.o. > [EMAIL PROTECTED] > Tel: +420 541 143 065 > Fax: +420 541 143 066 > http://www.optimsys.cz > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Sofia-sip-devel mailing list > Sofia-sip-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Sofia-sip-devel mailing list Sofia-sip-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel