datacommsserver/esockserver/test/providers/dummy/src/dummypr_connprov.cpp
branchRCL_3
changeset 66 cbb19216b74d
parent 48 07656293a99c
equal deleted inserted replaced
48:07656293a99c 66:cbb19216b74d
    45 using namespace Messages;
    45 using namespace Messages;
    46 using namespace ESock;
    46 using namespace ESock;
    47 using namespace MeshMachine;
    47 using namespace MeshMachine;
    48 using namespace PRActivities;
    48 using namespace PRActivities;
    49 
    49 
    50 //We reserve space for two preallocated activities that may start concurrently on the CPR
       
    51 //node: destroy and data client stop.
       
    52 static const TUint KDefaultMaxPreallocatedActivityCount = 2;
       
    53 static const TUint KMaxPreallocatedActivitySize = sizeof(MeshMachine::CNodeRetryParallelActivity) + sizeof(MeshMachine::APreallocatedOriginators<4>);
       
    54 static const TUint KDummyCPRPreallocatedActivityBufferSize = KDefaultMaxPreallocatedActivityCount * KMaxPreallocatedActivitySize;
       
    55 static const TUint KDestroyDelay = 3000;
    50 static const TUint KDestroyDelay = 3000;
    56 //-================================================
    51 //-================================================
    57 //
    52 //
    58 // States and Transitions
    53 // States and Transitions
    59 //
    54 //
   249 
   244 
   250 CDummyConnectionProvider* CDummyConnectionProvider::NewL(ESock::CConnectionProviderFactoryBase& aFactory, TConnType aConnStatus)
   245 CDummyConnectionProvider* CDummyConnectionProvider::NewL(ESock::CConnectionProviderFactoryBase& aFactory, TConnType aConnStatus)
   251     {
   246     {
   252     CDummyConnectionProvider* self = new (ELeave) CDummyConnectionProvider(aFactory, DummyCPRStates::stateMap::Self(), aConnStatus);
   247     CDummyConnectionProvider* self = new (ELeave) CDummyConnectionProvider(aFactory, DummyCPRStates::stateMap::Self(), aConnStatus);
   253     CleanupStack::PushL(self);
   248     CleanupStack::PushL(self);
   254     self->ConstructL(KDummyCPRPreallocatedActivityBufferSize);
   249     self->ConstructL();
   255     CleanupStack::Pop(self);
   250     CleanupStack::Pop(self);
   256     return self;
   251     return self;
   257     }
   252     }
   258 
   253 
   259 CDummyConnectionProvider* CDummyConnectionProvider::NewVanillaL(ESock::CConnectionProviderFactoryBase& aFactory)
   254 CDummyConnectionProvider* CDummyConnectionProvider::NewVanillaL(ESock::CConnectionProviderFactoryBase& aFactory)
   260     {
   255     {
   261     CDummyConnectionProvider* self = new (ELeave) CDummyConnectionProvider(aFactory, VanillaDummyCPRStates::stateMap::Self(), CDummyConnectionProvider::EConnNoIncoming);
   256     CDummyConnectionProvider* self = new (ELeave) CDummyConnectionProvider(aFactory, VanillaDummyCPRStates::stateMap::Self(), CDummyConnectionProvider::EConnNoIncoming);
   262     CleanupStack::PushL(self);
   257     CleanupStack::PushL(self);
   263     self->ConstructL(KDummyCPRPreallocatedActivityBufferSize);
   258     self->ConstructL();
   264     CleanupStack::Pop(self);
   259     CleanupStack::Pop(self);
   265     return self;
   260     return self;
   266     }
   261     }
   267 
   262 
   268 
   263