datacommsserver/esockserver/test/providers/dummy/src/dummypr_subconnprov.cpp
branchRCL_3
changeset 66 cbb19216b74d
parent 29 9644881fedd0
child 69 9d7ce34704c8
equal deleted inserted replaced
48:07656293a99c 66:cbb19216b74d
    35 	#define KDummySCPRTag KESockConnectionTag
    35 	#define KDummySCPRTag KESockConnectionTag
    36 #endif
    36 #endif
    37 
    37 
    38 using namespace ESock;
    38 using namespace ESock;
    39 using namespace MeshMachine;
    39 using namespace MeshMachine;
    40 
       
    41 //We reserve space for two preallocated activities that may start concurrently on the SCPR
       
    42 //node: destroy and data client stop.
       
    43 static const TUint KDefaultMaxPreallocatedActivityCount = 2;
       
    44 static const TUint KMaxPreallocatedActivitySize = sizeof(MeshMachine::CNodeRetryParallelActivity) + sizeof(MeshMachine::APreallocatedOriginators<4>);
       
    45 static const TUint KDummySCPRPreallocatedActivityBufferSize = KDefaultMaxPreallocatedActivityCount * KMaxPreallocatedActivitySize;
       
    46 
    40 
    47 namespace DummySCPRStates
    41 namespace DummySCPRStates
    48 {
    42 {
    49 DEFINE_SMELEMENT(TRaiseGranted, NetStateMachine::MStateTransition, DummySCPRStates::TContext)
    43 DEFINE_SMELEMENT(TRaiseGranted, NetStateMachine::MStateTransition, DummySCPRStates::TContext)
    50 void TRaiseGranted::DoL()
    44 void TRaiseGranted::DoL()
   123 TBool CrazyIdle::TAwaitingCancelled::Accept()
   117 TBool CrazyIdle::TAwaitingCancelled::Accept()
   124     {
   118     {
   125     if (iContext.iMessage.IsMessage<Messages::TEBase::TError>())
   119     if (iContext.iMessage.IsMessage<Messages::TEBase::TError>())
   126         {
   120         {
   127         ASSERT(iContext.iNodeActivity);
   121         ASSERT(iContext.iNodeActivity);
   128         iContext.iNodeActivity->SetPostedTo(iContext.iNodeActivity->SoleOriginator().Peer().RecipientId());
   122         iContext.iNodeActivity->SetPostedTo(iContext.iNodeActivity->SoleOriginator().Peer());
   129         }
   123         }
   130     return EFalse;
   124     return EFalse;
   131     }
   125     }
   132 }
   126 }
   133 
   127 
   229 
   223 
   230 CDummySubConnectionProvider* CDummySubConnectionProvider::NewL(ESock::CSubConnectionProviderFactoryBase& aFactory)
   224 CDummySubConnectionProvider* CDummySubConnectionProvider::NewL(ESock::CSubConnectionProviderFactoryBase& aFactory)
   231     {
   225     {
   232     CDummySubConnectionProvider* self = new (ELeave) CDummySubConnectionProvider(aFactory, DummySCPRStates::stateMap::Self());
   226     CDummySubConnectionProvider* self = new (ELeave) CDummySubConnectionProvider(aFactory, DummySCPRStates::stateMap::Self());
   233     CleanupStack::PushL(self);
   227     CleanupStack::PushL(self);
   234     self->ConstructL(KDummySCPRPreallocatedActivityBufferSize);
   228     self->ConstructL();
   235     CleanupStack::Pop(self);
   229     CleanupStack::Pop(self);
   236     return self;
   230     return self;
   237     }
   231     }
   238 
   232 
   239 CDummySubConnectionProvider* CDummySubConnectionProvider::NewVanillaL(ESock::CSubConnectionProviderFactoryBase& aFactory)
   233 CDummySubConnectionProvider* CDummySubConnectionProvider::NewVanillaL(ESock::CSubConnectionProviderFactoryBase& aFactory)
   240     {
   234     {
   241     CDummySubConnectionProvider* self = new (ELeave) CDummySubConnectionProvider(aFactory, VanillaDummySCPRStates::stateMap::Self());
   235     CDummySubConnectionProvider* self = new (ELeave) CDummySubConnectionProvider(aFactory, VanillaDummySCPRStates::stateMap::Self());
   242     CleanupStack::PushL(self);
   236     CleanupStack::PushL(self);
   243     self->ConstructL(KDummySCPRPreallocatedActivityBufferSize);
   237     self->ConstructL();
   244     CleanupStack::Pop(self);
   238     CleanupStack::Pop(self);
   245     return self;
   239     return self;
   246     }
   240     }
   247 
   241 
   248 
   242