datacommsserver/esockserver/ssock/ss_sapshim.cpp
branchRCL_3
changeset 26 b564fb5fd78b
parent 25 9d7ce34704c8
child 27 5ebd530e523b
equal deleted inserted replaced
25:9d7ce34704c8 26:b564fb5fd78b
   266     iProvider->SetNotify(this);
   266     iProvider->SetNotify(this);
   267 
   267 
   268 	return this;
   268 	return this;
   269     }
   269     }
   270 
   270 
       
   271 void CTransportFlowShim::HostResolverSpecificUnbind()
       
   272 	{
       
   273 	// Can't have both HR & SAP
       
   274 	__ASSERT_DEBUG(!iProvider, User::Panic(KSpecAssert_ESockSSocksspshm, 9));
       
   275 
       
   276 	if(iSubConnectionProvider.IsOpen())
       
   277 		{
       
   278 		iSessionControlNotify = NULL;
       
   279 		iSessionDataNotify = NULL;
       
   280 		iHostResolverNotify = NULL;
       
   281 		if (!Idle())
       
   282 			{
       
   283 			SetIdle();
       
   284 			ProcessDCIdleState();
       
   285 			}
       
   286 		}
       
   287 	else
       
   288 		{
       
   289 		DeleteThisFlow();
       
   290 		}
       
   291 	}
       
   292 
   271 void CTransportFlowShim::Unbind()
   293 void CTransportFlowShim::Unbind()
   272     {
   294     {
   273 	LOG( ESockLog::Printf(_L8("CTransportFlowShim %08x:\tUnbind()"), this) );
   295 	LOG( ESockLog::Printf(_L8("CTransportFlowShim %08x:\tUnbind()"), this) );
   274 
   296 
   275 	// Infant mortality case in which binding never completed,
   297 	// Infant mortality case in which binding never completed,
   277 		{
   299 		{
   278 		delete this;
   300 		delete this;
   279 		return;
   301 		return;
   280 		}
   302 		}
   281 
   303 
   282 	// Legacy support for host resolvers
   304 	// Legacy support for host resolvers involves a separate north bound MUpperControl interface
   283 	if(iHostResolverNotify)
   305 	if(iHostResolverNotify)
   284 		{
   306 		{
   285 		__ASSERT_DEBUG(!iProvider, User::Panic(KSpecAssert_ESockSSocksspshm, 9));	// can't have both HR & SAP
   307 		HostResolverSpecificUnbind();
   286 
   308 		}
   287 		LOG( ESockLog::Printf(_L8("CTransportFlowShim %08x:\tUnbind(): iBearerExpected %d"), this, BearerExpected()) );
   309 	else
   288 		if (!BearerExpected())
   310 		{
       
   311 		if (iProvider)
   289 			{
   312 			{
   290 			delete this;
   313 			iProvider->SetNotify(NULL);
       
   314 
       
   315 			if (!Detaching())
       
   316 				{
       
   317 				delete iProvider;
       
   318 				iProvider = NULL;
       
   319 				}
   291 			}
   320 			}
   292 		else
       
   293 			{
       
   294 			SetDeleteUponBearerReception();
       
   295 			iHostResolverNotify = NULL;
       
   296 			}
       
   297 		return;
       
   298 		}
       
   299 
       
   300 	if (iProvider)
       
   301 		{
       
   302 		iProvider->SetNotify(NULL);
       
   303 
       
   304 		if (!Detaching())
       
   305 			{
       
   306 			delete iProvider;
       
   307 			iProvider = NULL;
       
   308 			}
       
   309 		}
       
   310 
   321 
   311 #ifdef SYMBIAN_NETWORKING_UPS
   322 #ifdef SYMBIAN_NETWORKING_UPS
   312 	// Hook for derived classes to do cleanup before unbind occurs
   323 		// Hook for derived classes to do cleanup before unbind occurs
   313 	PreUnbind();
   324 		PreUnbind();
   314 #endif
   325 #endif
   315 
   326 		CNetworkFlow::Unbind();
   316 	CNetworkFlow::Unbind();
   327 		}
   317     }
   328     }
   318 
   329 
   319 ESock::CSubConnectionFlowBase& CTransportFlowShim::CloneFlowL()
   330 ESock::CSubConnectionFlowBase& CTransportFlowShim::CloneFlowL()
   320     {
   331     {
   321     __ASSERT_DEBUG(iProtocolIntf, User::Panic(KSpecAssert_ESockSSocksspshm, 10));
   332     __ASSERT_DEBUG(iProtocolIntf, User::Panic(KSpecAssert_ESockSSocksspshm, 10));