emailservices/emailstore/message_store/server/src/MessageStoreSession.cpp
changeset 62 a8c646b56683
parent 51 d845db10c0d4
child 68 83cc6bae1de8
equal deleted inserted replaced
57:ae34e1715e21 62:a8c646b56683
   115     iServer.AddSessionL( this );
   115     iServer.AddSessionL( this );
   116 
   116 
   117     // This could leave if a session is created while the store is unavailable.
   117     // This could leave if a session is created while the store is unavailable.
   118     TRAPD( err, iServer.MessageStoreL().ObserveL( this ) );
   118     TRAPD( err, iServer.MessageStoreL().ObserveL( this ) );
   119     
   119     
   120     if( err != KErrNone )
   120     // We need to leave the Session active in the case of KErrInUse.  This is
       
   121     // because if the observer is dropped during KErrInUse, they cannot
       
   122     // re-establish connection, and they will not know when MS in no longer busy.
       
   123     // As a result, they will retry for many seconds to connect, then permanently
       
   124     // give up.  This is avoided by trapping KErrInUse.
       
   125     // Thus, only dropSession and Leave for other errors
       
   126     
       
   127     if( err != KErrNone && err != KErrInUse )
   121     {
   128     {
   122         iServer.DropSession( this );
   129         iServer.DropSession( this );
   123         User::Leave( err );
   130         User::Leave( err );
   124     }
   131     }
   125     
   132