datacommsserver/esockserver/ssock/ss_sapshim.cpp
branchRCL_3
changeset 25 9d7ce34704c8
parent 24 00c6709d25aa
child 26 b564fb5fd78b
--- a/datacommsserver/esockserver/ssock/ss_sapshim.cpp	Thu Aug 19 11:05:47 2010 +0300
+++ b/datacommsserver/esockserver/ssock/ss_sapshim.cpp	Tue Aug 31 16:25:36 2010 +0300
@@ -268,28 +268,6 @@
 	return this;
     }
 
-void CTransportFlowShim::HostResolverSpecificUnbind()
-	{
-	// Can't have both HR & SAP
-	__ASSERT_DEBUG(!iProvider, User::Panic(KSpecAssert_ESockSSocksspshm, 9));
-
-	if(iSubConnectionProvider.IsOpen())
-		{
-		iSessionControlNotify = NULL;
-		iSessionDataNotify = NULL;
-		iHostResolverNotify = NULL;
-		if (!Idle())
-			{
-			SetIdle();
-			ProcessDCIdleState();
-			}
-		}
-	else
-		{
-		DeleteThisFlow();
-		}
-	}
-
 void CTransportFlowShim::Unbind()
     {
 	LOG( ESockLog::Printf(_L8("CTransportFlowShim %08x:\tUnbind()"), this) );
@@ -301,30 +279,41 @@
 		return;
 		}
 
-	// Legacy support for host resolvers involves a separate north bound MUpperControl interface
+	// Legacy support for host resolvers
 	if(iHostResolverNotify)
 		{
-		HostResolverSpecificUnbind();
-		}
-	else
-		{
-		if (iProvider)
+		__ASSERT_DEBUG(!iProvider, User::Panic(KSpecAssert_ESockSSocksspshm, 9));	// can't have both HR & SAP
+
+		LOG( ESockLog::Printf(_L8("CTransportFlowShim %08x:\tUnbind(): iBearerExpected %d"), this, BearerExpected()) );
+		if (!BearerExpected())
+			{
+			delete this;
+			}
+		else
 			{
-			iProvider->SetNotify(NULL);
+			SetDeleteUponBearerReception();
+			iHostResolverNotify = NULL;
+			}
+		return;
+		}
 
-			if (!Detaching())
-				{
-				delete iProvider;
-				iProvider = NULL;
-				}
+	if (iProvider)
+		{
+		iProvider->SetNotify(NULL);
+
+		if (!Detaching())
+			{
+			delete iProvider;
+			iProvider = NULL;
 			}
+		}
 
 #ifdef SYMBIAN_NETWORKING_UPS
-		// Hook for derived classes to do cleanup before unbind occurs
-		PreUnbind();
+	// Hook for derived classes to do cleanup before unbind occurs
+	PreUnbind();
 #endif
-		CNetworkFlow::Unbind();
-		}
+
+	CNetworkFlow::Unbind();
     }
 
 ESock::CSubConnectionFlowBase& CTransportFlowShim::CloneFlowL()