networkcontrol/ipnetworklayer/src/flow.cpp
changeset 14 b33c3d136b7e
parent 0 af10295192d8
equal deleted inserted replaced
1:a579325b79dd 14:b33c3d136b7e
   339 			protoList.Set(protoList.Mid(pos + 1));
   339 			protoList.Set(protoList.Mid(pos + 1));
   340 			}
   340 			}
   341 
   341 
   342 		if (proto.Length() > 0)
   342 		if (proto.Length() > 0)
   343 			{
   343 			{
   344 			CIPProtoBinder* protoBinder = CIPProtoBinder::NewL(*this, proto);
   344             CIPProtoBinder* protoBinder = FindBinderForProto(proto); 
   345 			CleanupStack::PushL(protoBinder);
   345             if (!protoBinder)
   346 
   346                 {
   347 			CIPShimIfBase* nif = ProtocolIntf()->FindOrCreateNifL(proto,
   347                 protoBinder = CIPProtoBinder::NewL(*this, proto);
   348 				reinterpret_cast<const TConnectionInfo&>(*iConnectionInfo.Ptr()));
   348                 CleanupStack::PushL(protoBinder);
   349 			TCleanupNifPair cleanuppair(nif);
   349 
   350 			CleanupStack::PushL(TCleanupItem(TCleanupNifPair::CleanupReleaseNif, &cleanuppair));
   350                 CIPShimIfBase* nif = ProtocolIntf()->FindOrCreateNifL(proto,
   351 
   351                     reinterpret_cast<const TConnectionInfo&>(*iConnectionInfo.Ptr()));
   352 			__CFLOG_VAR((KIPProtoTag1, KIPProtoTag2, _L8("CIPShimSubConnectionFlow %08x:\tBindToL(): nif 0x%08x, binder 0x%08x"), this, nif, protoBinder));
   352                 TCleanupNifPair cleanuppair(nif);
   353 			nif->BindToL(protoBinder);
   353                 CleanupStack::PushL(TCleanupItem(TCleanupNifPair::CleanupReleaseNif, &cleanuppair));
   354 			cleanuppair.iBinder = protoBinder;
   354 
   355 
   355                 __CFLOG_VAR((KIPProtoTag1, KIPProtoTag2, _L8("CIPShimSubConnectionFlow %08x:\tBindToL(): nif 0x%08x, binder 0x%08x"), this, nif, protoBinder));
   356 			protoBinder->BindToLowerFlowL(*binderControl);
   356                 nif->BindToL(protoBinder);
   357 
   357                 cleanuppair.iBinder = protoBinder;
   358 			iBinderList.AppendL(protoBinder);
   358     
   359 
   359                 protoBinder->BindToLowerFlowL(*binderControl);
   360 			CleanupStack::Pop(2);
   360     
   361 
   361                 iBinderList.AppendL(protoBinder);
   362 			InitialiseDataMonitoringL(nif);
   362 
       
   363                 CleanupStack::Pop(2);
       
   364 
       
   365                 InitialiseDataMonitoringL(nif);
       
   366                 }
       
   367             else
       
   368                 {
       
   369                 InitialiseDataMonitoringL(protoBinder->iNif);
       
   370                 }
   363 			}
   371 			}
   364 		}
   372 		}
   365 	while (pos != KErrNotFound);
   373 	while (pos != KErrNotFound);
   366 
   374 
   367 	NM_LOG((KIPProtoTag1, _L8("CIPShimSubConnectionFlow %08x:\tSynchronous call: From=%08x To=%08x Func=BindToL"), this, static_cast<Messages::ANode*>(this), &mcfNode));
   375 	NM_LOG((KIPProtoTag1, _L8("CIPShimSubConnectionFlow %08x:\tSynchronous call: From=%08x To=%08x Func=BindToL"), this, static_cast<Messages::ANode*>(this), &mcfNode));
   371 		{
   379 		{
   372 		iBinderList[i]->StartL();
   380 		iBinderList[i]->StartL();
   373 		}
   381 		}
   374 	}
   382 	}
   375 
   383 
   376 
   384 CIPProtoBinder* CIPShimSubConnectionFlow::FindBinderForProto(const TDesC8& aProtocol)
       
   385     {
       
   386     TInt i = iBinderList.Count();
       
   387     while (--i >= 0)
       
   388         {
       
   389         if (iBinderList[i]->iProtocolName == aProtocol)
       
   390             {
       
   391             __CFLOG_VAR((KIPProtoTag1, KIPProtoTag2, _L8("CIPShimSubConnectionFlow %08x:\tFindBinderForProto(): Found existing binder for proto '%S'"),
       
   392                 this, &aProtocol));
       
   393             return iBinderList[i];
       
   394             }
       
   395         }
       
   396     __CFLOG_VAR((KIPProtoTag1, KIPProtoTag2, _L8("CIPShimSubConnectionFlow %08x:\tFindBinderForProto(): No binder for proto '%S'"),
       
   397         this, &aProtocol));
       
   398     return NULL;
       
   399     }
   377 
   400 
   378 void CIPShimSubConnectionFlow::StartFlowL()
   401 void CIPShimSubConnectionFlow::StartFlowL()
   379 /**
   402 /**
   380 Message from SCPR to start.
   403 Message from SCPR to start.
   381 */
   404 */