Slightly simplar DestroySession!

Heya,
rather than go all complicated solution I just do a simple check if named session exsit then destroy.

Any thoughts what could go wrong with this?

Since DestroySession is asynchronous, you can not know when the session has actually been destroyed. In your case, you could end up with a race condition - your call to CreateSession could finish before the DestroySession call has finished, resulting in a failure to create the new session.

This is why Sam uses the more complicated solution in the code, as should you. By using the delegate function for destroying the session, you are guaranteed to have destroyed it before calling Create.

Hope this helps you :slight_smile:
// noxet

4 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms