fotaapplication/fmsclient/src/fmsclient.cpp
changeset 73 ae69c2e8bc34
parent 51 2e64dc50f295
equal deleted inserted replaced
71:d2517372cc44 73:ae69c2e8bc34
    93 	TInt res = KErrNone;
    93 	TInt res = KErrNone;
    94 	TBool FotaStartUp = EFalse;
    94 	TBool FotaStartUp = EFalse;
    95 	if( IsSecureClient(FotaStartUp))
    95 	if( IsSecureClient(FotaStartUp))
    96 		{
    96 		{
    97 		FLOG(_L("RFMSClient::OpenL()- Secured client"));
    97 		FLOG(_L("RFMSClient::OpenL()- Secured client"));
    98 		res = CreateSession( KFMSServerName,TVersion(1,0,0),2 );
    98 		
    99 		if ( res != KErrNone )
    99 		const int maxRetry(4);
   100 			{
   100 		TInt retry = maxRetry;
   101 			FLOG(_L("RFMSClient::OpenL()- session not created"));
   101 		do {
   102 			res = StartServerL();
   102          res = CreateSession( KFMSServerName,TVersion(1,0,0),2 );
   103 			User::LeaveIfError( res );
   103          if (KErrNotFound != res && KErrServerTerminated != res) {
   104 			res = CreateSession( KFMSServerName,TVersion(1,0,0),2 );
   104              retry =0;
   105 			}
   105          } else {
       
   106              TRAP(res, StartServerL());
       
   107              if (KErrNone == res || KErrAlreadyExists == res) {
       
   108                  retry =0;
       
   109                  res = CreateSession( KFMSServerName,TVersion(1,0,0),2 );
       
   110              }
       
   111          }
       
   112      } while (--retry > 0);
   106 		User::LeaveIfError( res );
   113 		User::LeaveIfError( res );
   107 		FLOG(_L("RFMSClient::OpenL()- session created"));
   114 		FLOG(_L("RFMSClient::OpenL()- session created"));
   108 		CRepository* centrep2 = NULL;
   115 		CRepository* centrep2 = NULL;
   109     TRAPD( err, centrep2 = CRepository::NewL( KCRUidFotaServer ) )
   116     TRAPD( err, centrep2 = CRepository::NewL( KCRUidFotaServer ) )
   110     TInt val = KErrNone;
   117     TInt val = KErrNone;