Sorry for the half message, I've hit the send button too early, full message is below:
From: [email protected] [mailto:[email protected]] On Behalf Of Bert Fraterman Sent: maandag 21 september 2009 13:41 To: [email protected] Subject: [Sems] Problem with early session destruction Hello, I have developed a SEMS application in C++, but I had problems with too early destroyed sessions: First, the BYE is send, and my sessions wait for some event, which is launched by a separate thread. After this event is launched, the session is stopped with the setStopped() method call. Sometimes, the session was destroyed before I called the setStopped() method, which made me delve into the SEMS code. I believe this code is responsible for this behavior (SEMS 1.1.0): void AmSession::run() { try { try { onStart(); while (!sess_stopped.get() || (dlg.getStatus() == AmSipDialog::Disconnecting)// || // (dlg.getUACTransPending()) ){ It seems to me that the main loop waits for the session to reach the stopped status or the status 'Disconnecting'. I can't see the logic in this, since in most cases, the loop will wait for the setStopped() method call and be destroyed after that, but in very few cases (when the while-check is made, the call is in disconnecting status) the call is also destroyed. So once I send a BYE, the session might be destroyed, but I have no guarantee. This makes it impossible to wait for an (non SEMS) event after sending a BYE, since the session might soon be destroyed. I'm not sure why this code is structured like this, I think it would be better if SEMS behaved in one of following two modes: - Destroy the session only once the setStopped() method was called. - Destroy the session if the setStopped() method was called or when the dialog has the disconnecting or disconnected status. This way there is more consistent behavior in the destruction of sessions. Is the code in AmSession intended this way? The comments suggest it is incomplete, could this be fixed? Kind regards, Bert Fraterman Tolnasingel 1 2411 PV Bodegraven Mobiel Email Website +31(0)6-30102385 [email protected] <mailto:[email protected]> www.winitucom.com/ <http://www.winitucom.com/> This message (including any attachments) is confidential and may be privileged. If you have received it by mistake please notify the sender by return e-mail and delete this message from your system. Any unauthorised use or dissemination of this message in whole or in part is strictly prohibited. Please note that e-mails are susceptible to change. Winitu Communications B.V. shall not be liable for the improper or incomplete transmission of the information contained in this communication nor for any delay in its receipt or damage to your system. Winitu Communications B.V. does not guarantee that the integrity of this communication has been maintained nor that this communication is free of viruses, interceptions or interference.
<<image001.jpg>>
<<image002.jpg>>
_______________________________________________ Sems mailing list [email protected] http://lists.iptel.org/mailman/listinfo/sems
