datacommsserver/esockserver/ssock/ss_nodemessages_legacy.cpp
changeset 25 e53adc4c49de
parent 4 928ed51ddc43
equal deleted inserted replaced
22:592244873960 25:e53adc4c49de
   101 void TCFSigLegacyRMessage2Ext::ForwardRequestL(MeshMachine::TNodeContextBase& aContext)
   101 void TCFSigLegacyRMessage2Ext::ForwardRequestL(MeshMachine::TNodeContextBase& aContext)
   102 	{
   102 	{
   103 	ASSERT(aContext.Activity() != NULL);
   103 	ASSERT(aContext.Activity() != NULL);
   104 	RNodeInterface* rcpt = NULL;
   104 	RNodeInterface* rcpt = NULL;
   105 
   105 
   106 	/* At the connection level we want to go down active serviceprovider, as there are multiple
   106 	rcpt = aContext.Node().GetFirstClient<TDefaultClientMatchPolicy>(TClientType(TCFClientType::EServProvider, TCFClientType::EActive),
   107 	   and the first one is usually an scpr */
       
   108 	if (aContext.Activity()->ActivitySigId() == ECFActivityConnectionLegacyRMessage2Handler)
       
   109 		{
       
   110 		rcpt = aContext.Node().GetFirstClient<TDefaultClientMatchPolicy>(TClientType(TCFClientType::EServProvider, TCFClientType::EActive),
       
   111 			Messages::TClientType(0, Messages::TClientType::ELeaving));
   107 			Messages::TClientType(0, Messages::TClientType::ELeaving));
   112 		}
       
   113 	else
       
   114 		{
       
   115 		rcpt = aContext.Node().GetFirstClient<TDefaultClientMatchPolicy>(TClientType(TCFClientType::EServProvider),
       
   116 			Messages::TClientType(0, Messages::TClientType::ELeaving));
       
   117 		}
       
   118 
   108 
   119     if(rcpt)
   109     if(rcpt)
   120     	{
   110     	{
   121 		aContext.Activity()->PostRequestTo(*rcpt, *this);
   111 		aContext.Activity()->PostRequestTo(*rcpt, *this);
   122     	}
   112     	}
   506     ASSERT(EFalse);//should never get there. if so than we need to derive from TCFSigRMessage2Ext
   496     ASSERT(EFalse);//should never get there. if so than we need to derive from TCFSigRMessage2Ext
   507     //to add RMessage and complete with error
   497     //to add RMessage and complete with error
   508     }
   498     }
   509 
   499 
   510 
   500 
       
   501 void CLegacyDataMonitoringResponder::DoComplete(TInt aError)
       
   502     {
       
   503     iLegacyResponseMsg.Complete(aError);
       
   504     }
       
   505 
   511 void CLegacyDataMonitoringResponder::DoCancelRequest()
   506 void CLegacyDataMonitoringResponder::DoCancelRequest()
   512 	{
   507 	{
   513 	iLegacyResponseMsg.Complete(KErrCancel);
   508 	iLegacyResponseMsg.Complete(KErrCancel);
   514 	}
   509 	}
   515 
   510 
   729 	
   724 	
   730 	// Create a ResponseMsg and responder for completing the client
   725 	// Create a ResponseMsg and responder for completing the client
   731 	RLegacyResponseMsg responseMsg(aContext, iMessage, iMessage.Int0());
   726 	RLegacyResponseMsg responseMsg(aContext, iMessage, iMessage.Int0());
   732 	CDataMonitoringResponder* responder = CLegacyDataMonitoringResponder::NewL(responseMsg);
   727 	CDataMonitoringResponder* responder = CLegacyDataMonitoringResponder::NewL(responseMsg);
   733 
   728 
   734     	ADataMonitoringProtocolReq& dataMonItf = *static_cast<ADataMonitoringProtocolReq*>(interface);
   729     ADataMonitoringProtocolReq& dataMonItf = *static_cast<ADataMonitoringProtocolReq*>(interface);
   735     	switch(iDirection)
   730     switch(iDirection)
   736     		{
   731         {
   737 		case ESent:
   732 		case ESent:
   738 			dataMonItf.RequestDataSentNotification(responder, delta, volume, iClientId);
   733 			dataMonItf.RequestDataSentNotification(responder, delta, volume, iClientId);
   739 			break;
   734 			break;
   740 
   735 
   741 		case EReceived:
   736 		case EReceived:
   742 			dataMonItf.RequestDataReceivedNotification(responder, delta, volume, iClientId);
   737 			dataMonItf.RequestDataReceivedNotification(responder, delta, volume, iClientId);
   743 			break;
   738 			break;
       
   739 		
   744 		default:
   740 		default:
   745 			delete responder;
   741 			delete responder;
   746     		}
   742         }
   747 	// coverity [leaked_storage] - responder is owned by dataMonItf.RequestDataSentNotification, dataMonItf.RequestDataReceivedNotification
   743 	// coverity [leaked_storage] - responder is owned by dataMonItf.RequestDataSentNotification, dataMonItf.RequestDataReceivedNotification
   748 	// therefore we don't need to push them onto the cleanup stack.
   744 	// therefore we don't need to push them onto the cleanup stack.
   749     	}
   745 	}
   750 
   746 
   751 void TLegacyDataMonitoringNotificationRequest::Cancel(MeshMachine::TNodeContextBase& aContext)
   747 void TLegacyDataMonitoringNotificationRequest::Cancel(MeshMachine::TNodeContextBase& aContext)
   752 	{
   748 	{
   753 	TAny* interface = FetchInterfaceL(aContext.Node(), EDataMonitoringApiExt);
   749 	TAny* interface = FetchInterfaceL(aContext.Node(), EDataMonitoringApiExt);
   754 	ASSERT(interface);
   750 	ASSERT(interface);
   755 	
   751 	
   756 	if (interface)
   752     if (interface)
   757     	{
   753     	{
   758     	ADataMonitoringProtocolReq& dataMonItf = *static_cast<ADataMonitoringProtocolReq*>(interface);
   754     	ADataMonitoringProtocolReq& dataMonItf = *static_cast<ADataMonitoringProtocolReq*>(interface);
   759 		
   755 		
   760     	switch(iDirection)
   756     	switch(iDirection)
   761     		{
   757     		{