supl/locationsuplfw/protocolhandlerapi/src/epos_csuplcommunicationmanager.cpp
branchRCL_3
changeset 18 d746aee05493
parent 0 667063e416a2
child 20 2b4ea9893b66
--- a/supl/locationsuplfw/protocolhandlerapi/src/epos_csuplcommunicationmanager.cpp	Mon Jun 21 16:08:35 2010 +0300
+++ b/supl/locationsuplfw/protocolhandlerapi/src/epos_csuplcommunicationmanager.cpp	Thu Jul 15 19:06:58 2010 +0300
@@ -36,8 +36,8 @@
 
 // ============================ MEMBER FUNCTIONS ===============================
 
-CSuplCommunicationManager::CSuplCommunicationManager():
-	iServerConnected(EFalse)
+CSuplCommunicationManager::CSuplCommunicationManager(MSuplConnectionMonitor& aConnMonitor):
+	iServerConnected(EFalse), iConnMonitor(aConnMonitor)
     {
     }
 
@@ -49,9 +49,9 @@
 	iTrace->Trace(_L("CSuplCommunicationManager::ConstructL"), KTraceFileName, __LINE__); 
     }
 
-EXPORT_C CSuplCommunicationManager* CSuplCommunicationManager::NewL()
+EXPORT_C CSuplCommunicationManager* CSuplCommunicationManager::NewL(MSuplConnectionMonitor& aConnMonitor)
     {
-    CSuplCommunicationManager* self = new( ELeave ) CSuplCommunicationManager;
+    CSuplCommunicationManager* self = new( ELeave ) CSuplCommunicationManager(aConnMonitor);
     
     CleanupStack::PushL( self );
     self->ConstructL();
@@ -127,7 +127,8 @@
     	suplConnection = CSuplConnection::NewL(iSocketServ, aHostAddress, aPort, aIAPId, this);	
     	iConnArray.Append(suplConnection);
     	iTrace->Trace(_L("CSuplCommunicationManager::CreateConnectionL New Connection Created"), KTraceFileName, __LINE__);
-    	}
+    	iConnMonitor.ConnectionOpened();
+    }
     else
     	{
     	// Check if we have exceeded the max no. of sessions 
@@ -140,8 +141,9 @@
     		suplConnection = CSuplConnection::NewL(iSocketServ, aHostAddress, aPort, aIAPId, this);
     		iConnArray.Append(suplConnection);
     		iTrace->Trace(_L("CSuplCommunicationManager::CreateConnectionL New Connection Created"), KTraceFileName, __LINE__);
-    		}
+        	iConnMonitor.ConnectionOpened();
     	}
+    }
     
     // Increment the Ref Count
     suplConnection->IncRefCount();
@@ -181,6 +183,7 @@
     	{
         suplConnection = CSuplConnection::NewL(iSocketServ, aHostAddress, aPort, aIAPId, aTls, aPskTls, this); 
         iConnArray.Append(suplConnection);
+       	iConnMonitor.ConnectionOpened();
         iTrace->Trace(_L("CSuplCommunicationManager::CreateConnectionL New Connection Created"), KTraceFileName, __LINE__);
     	}
     else
@@ -194,6 +197,7 @@
         	{
             suplConnection = CSuplConnection::NewL(iSocketServ, aHostAddress, aPort, aIAPId, aTls, aPskTls, this);
             iConnArray.Append(suplConnection);
+        	iConnMonitor.ConnectionOpened();
             iTrace->Trace(_L("CSuplCommunicationManager::CreateConnectionL New Connection Created"), KTraceFileName, __LINE__);
         	}
     	}
@@ -243,6 +247,8 @@
     iTrace->Trace(_L("CSuplCommunicationManager::DestroyConnection Destroy Connection"), KTraceFileName, __LINE__);
     aConnection->Destroy();
     
+    iConnMonitor.ConnectionClosed();
+    
     return KErrNone;
     }