Hello Bert,

o Bert Fraterman [02/10/09 14:32]:
- setStopped(); is called, but this doesn't generate an event. Session
is still in waitForEvent();
where (which thread?) do you call setStopped()?

- Because no more events are sent to the session, the session
effectively hangs in waitForEvent();
- Only when SEMS is terminated (ctrl + c), all sessions are sent an
event to clean up, the session wakes from waitForEvent(); and closes
down without a problem.


When I generate a bogus event after calling setStopped(), the session
closes down properly:
        this->setStopped();
        this->postEvent(new AmEvent(93874));

>...

> If this is a bug, I suggest either setStopped() would generate an event
> to notify the session it is being stopped, or the session cleaner sends
> periodic events to clean up the sessions which have stranded this way.
>

If you call setStopped() from within the event loop, it should work. if you call setStopped() from outside, you should just post a bogus event to the session, like you did. As this is really a corner case, I would not really like to always post a bogus event - the loop would run one more time (with all dynamic_casts) for nothing.

It would be nice though to document this, i.e. patches to the doxygen documentation are always welcome. Maybe we should start a dev FAQ?

Stefan

--
Stefan Sayer
VoIP Services

[email protected]
www.iptego.com

IPTEGO GmbH
Wittenbergplatz 1
10789 Berlin
Germany

Amtsgericht Charlottenburg, HRB 101010
Geschaeftsfuehrer: Alexander Hoffmann
_______________________________________________
Sems mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/sems

Reply via email to