本文整理汇总了C++中TCommDbConnPref::SetConnectionAttempts方法的典型用法代码示例。如果您正苦于以下问题:C++ TCommDbConnPref::SetConnectionAttempts方法的具体用法?C++ TCommDbConnPref::SetConnectionAttempts怎么用?C++ TCommDbConnPref::SetConnectionAttempts使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TCommDbConnPref
的用法示例。
在下文中一共展示了TCommDbConnPref::SetConnectionAttempts方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: doTestStepL
TVerdict CTestConnectStep::doTestStepL()
/**
* @return - TVerdict code
* Override of base class pure virtual
* Demonstrates reading configuration parameters fom an ini file section
*/
{
if(TestStepResult()==EPass)
{
INFO_PRINTF1(_L("In Test Step ConnectWithOverrides"));
// When bootstrapping C32 we have to avoid the PhBkSyncServer being started, since
// it needs a different CommDB
TInt ret = StartC32WithCMISuppressions(KPhbkSyncCMI);
if((ret!=KErrNone) && (ret!=KErrAlreadyExists))
{
INFO_PRINTF2(_L("error is : %d \n"),ret);
}
else
{
INFO_PRINTF1(_L("Started C32\n"));
}
RHostResolver hr;
INFO_PRINTF1(_L("Connect to RSocketServ"));
User::LeaveIfError(iSocketServ.Connect());
// Set up the connections, both overridden as host resolver won't work
// on the default interface
INFO_PRINTF1(_L("Open the RConnection interface"));
User::LeaveIfError(iConnection.Open(iSocketServ));
// get the IapNumber value from the ini file
if(!GetIntFromConfig(ConfigSection(), KIapNumber, iIapNumber))
{
if(!GetIntFromConfig(KIap, KIapNumber, iIapNumber))
{
iIapNumber=1;
INFO_PRINTF1(_L("Failed to read Iap from ini file, using default"));
}
}
INFO_PRINTF2((_L("IapNumber = %d")), iIapNumber);
TRequestStatus status;
#ifdef SIROCCO_CODE_MIGRATION
TCommDbConnPref prefs;
prefs.SetIapId(iIapNumber);
prefs.SetDialogPreference(ECommDbDialogPrefDoNotPrompt);
const TUid KMyPropertyCat = {0x101FD9C5};
const TUint32 KMyPropertyDestPortv4 = 67;
TInt err = RProperty::Define(KMyPropertyCat, KMyPropertyDestPortv4, RProperty::EInt, TSecurityPolicy(TSecurityPolicy::EAlwaysPass),
TSecurityPolicy(ECapabilityWriteDeviceData));
User::LeaveIfError(RProperty::Set(KMyPropertyCat, KMyPropertyDestPortv4, 93));
#else
TInt rank = 1;
// Create a multiple connection preference object
TCommDbMultiConnPref prefs;
for(TInt i=0;i<iapCount;i++)
{
TCommDbConnPref pref;
// Set the direction
pref.SetDirection(ECommDbConnectionDirectionOutgoing);
// Set the bear ser
pref.SetBearerSet(KCommDbBearerPSD | KCommDbBearerCSD);
// Set the IAP
pref.SetIapId(iIapNumber + i);
// Set the dialog preference to Do Not Prompt
pref.SetDialogPreference(ECommDbDialogPrefDoNotPrompt);
// Set the rank
User::LeaveIfError(prefs.SetPreference(rank, pref));
rank++;
}
prefs.SetConnectionAttempts(rank-1);
#endif
// Start the connection
iConnection.Start(prefs, status);
User::WaitForRequest(status);
TInt result = status.Int();
if(result!=KErrNone)
{
ERR_PRINTF2(_L("Failed to start connection. Error %d"), result);
SetTestStepResult(EFail);
User::Leave(EFail);
}
else
{
INFO_PRINTF1(_L("Connection started with overrides"));
}
//.........这里部分代码省略.........